From cf27f5466085f101e2b9cdb32dbbb24ca5a5691c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 20:36:52 +0000 Subject: [PATCH 1/3] chore: pin GitHub Actions to SHA commits on master-java8 Agent-Logs-Url: https://github.com/kubernetes-client/java/sessions/08f7f810-1768-4b14-80b6-d65e39588846 Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com> --- .github/dependabot.yml | 6 +-- .github/workflows/codeql-analysis.yml | 23 +++------ .github/workflows/generate-crd.yml | 4 +- .github/workflows/generate.yml | 34 +++----------- .github/workflows/maven.yml | 67 ++++++++++----------------- .github/workflows/release.yml | 40 +++++++--------- .github/workflows/snapshot.yml | 8 +--- 7 files changed, 64 insertions(+), 118 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ef5b19dea1..a0bd4a8bd0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,14 +5,14 @@ updates: schedule: interval: "daily" time: "02:00" - - package-ecosystem: "maven" + - package-ecosystem: "github-actions" directory: "/" - target-branch: "master-java8" schedule: interval: "daily" - time: "02:00" + time: "03:00" - package-ecosystem: "github-actions" directory: "/" + target-branch: "master-java8" schedule: interval: "daily" time: "03:00" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5661aeae1b..ea01c3bc17 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,17 +3,9 @@ name: "CodeQL" on: push: branches: [ master ] - paths: - - '**/*.java' - - '**/pom.xml' - - '.github/workflows/codeql-analysis.yml' pull_request: # The branches below must be a subset of the branches above branches: [ master ] - paths: - - '**/*.java' - - '**/pom.xml' - - '.github/workflows/codeql-analysis.yml' schedule: - cron: '37 19 * * 0' @@ -36,22 +28,21 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4 + uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2 with: languages: ${{ matrix.language }} + tools: 'https://github.com/github/codeql-action/releases/download/codeql-bundle-20230524/codeql-bundle-linux64.tar.gz' - # See https://github.com/github/codeql/issues/13541 for the origins of this command - # We can't use autobuild because it doesn't detect the right Java version - - name: Build project - run: ./mvnw clean package -f "pom.xml" -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true + - name: Autobuild + uses: github/codeql-action/autobuild@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4 + uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2 diff --git a/.github/workflows/generate-crd.yml b/.github/workflows/generate-crd.yml index 895423e9cd..37aa62669b 100644 --- a/.github/workflows/generate-crd.yml +++ b/.github/workflows/generate-crd.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Run CRD Model Generation run: | read CRD_SRC_ARGS < <(echo '${{ github.event.inputs.crds }}' | perl -ne 'print join " ", map {"-u $_"} split /,/') @@ -48,7 +48,7 @@ jobs: -p ${{ github.event.inputs.generatingJavaPackage }} \ -o "$(pwd)/${GEN_DIR}" ls -lh ${GEN_DIR} - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + - uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3 with: name: generated-java-crd-model path: | diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 56fe64c6c9..b538e1703e 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -17,11 +17,6 @@ on: required: true default: false description: If true, skip patching code after generation - skip_proto: - type: boolean - required: false - default: false - description: If true, skip proto generation permissions: contents: read @@ -35,16 +30,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Java - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: token: ${{ secrets.PAT_TOKEN }} - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x - name: Checkout Gen - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: path: gen repository: kubernetes-client/gen @@ -76,30 +71,19 @@ jobs: export PACKAGE_NAME="io.kubernetes.client.openapi" EOF - USE_SINGLE_PARAMETER=true bash java.sh ../../kubernetes/ settings + USE_SINGLE_PARAMETER=false OPENAPI_GENERATOR_COMMIT=v4.3.1 bash java.sh ../../kubernetes/ settings popd + rm -rf gen git config user.email "k8s-publishing-bot@users.noreply.github.com" git config user.name "Kubernetes Publisher" git checkout -b "$BRANCH" git add . git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' - - name: Generate Proto - if: ${{ github.event.inputs.skip_proto != 'true' }} - run: | - pushd gen/proto - # Download proto dependencies for the specified Kubernetes branch - bash dependencies.sh "${{ github.event.inputs.kubernetesBranch }}" - # Generate Java proto classes - bash generate.sh java ../../proto/src/main/java/ - popd - rm -rf gen - git add proto/ - git commit -s -m 'Automated proto generation from ${{ github.event.inputs.kubernetesBranch }}' - name: Apply Manual Diffs if: ${{ github.event.inputs.skip_patches != 'true' }} run: | - ls scripts/patches/*.diff | xargs -I {} bash -xc 'patch -p1 < "{}"' - git add *.java + ls scripts/patches/*.diff | xargs git apply + git add . git commit -s -m 'Applied patches under scripts/patches/*.diff' - name: Generate Fluent run: | @@ -130,7 +114,3 @@ jobs: destination_branch: ${{ github.ref_name }} github_token: ${{ secrets.PAT_TOKEN }} pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}" - - - - diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e5f1bd4275..6d0d8b10a9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -6,52 +6,39 @@ name: build on: push: branches: [ "master", "master-java8", "release-**" ] - paths: - - '**/*.java' - - '**/pom.xml' - - '.mvn/**' - - 'mvnw' - - 'mvnw.cmd' - - '.github/workflows/maven.yml' pull_request: branches: [ "master", "master-java8", "release-**" ] - paths: - - '**/*.java' - - '**/pom.xml' - - '.mvn/**' - - 'mvnw' - - 'mvnw.cmd' - - '.github/workflows/maven.yml' jobs: verify-format: runs-on: ubuntu-latest name: Verify Source Format steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17 - name: Verify Format and License - run: ./mvnw spotless:check + run: mvn spotless:check build: name: Java ${{ matrix.java }} Maven Test on ${{ matrix.os }} strategy: matrix: - java: [ 11.0.x, 17.0.x, 21.0.x ] - os: [ macos-latest, windows-latest, ubuntu-latest ] + # Test against the LTS Java versions. TODO: add JDK18 when it becomes available. + java: [ 8.0.x ] + os: [ windows-latest, ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: ${{ matrix.java }} - name: Cache local Maven repository - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }} @@ -64,56 +51,54 @@ jobs: EXCLUDED_EXAMPLE_MODULES=`ls examples | grep examples | xargs -I {} echo '!examples/{}' | tr '\n' ',' | sed 's/.$//'` MODS_OVERRIDES=$MODS_OVERRIDES,$EXCLUDED_EXAMPLE_MODULES fi - ./mvnw -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $MODS_OVERRIDES clean test + mvn -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $MODS_OVERRIDES clean test build-graalvm: runs-on: ubuntu-latest name: GraalVM Maven Test steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - uses: graalvm/setup-graalvm@60c26726de13f8b90771df4bc1641a52a3159994 # v1 with: version: '22.3.0' java-version: '17' components: 'native-image' - name: Build with Maven - run: ./mvnw -q test -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + run: mvn -q test -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn e2e: runs-on: ubuntu-latest name: End-to-End Test Against Real Cluster steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Create k8s Kind Cluster - uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 + uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x - name: Run E2E with Maven run: | - ./mvnw clean install \ + mvn clean install \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -q \ -Dmaven.test.skip=true cd e2e - ../mvnw test \ + mvn test \ -B \ -De2e.skip=false \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - env: - mvnw: ${{ github.workspace }}/mvnw examples: runs-on: ubuntu-latest name: Examples smoke test steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x - name: Cache local Maven repository - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -121,21 +106,21 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven run: | - ./mvnw clean install \ + mvn clean install \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -q \ -Dmaven.test.skip=true - name: Build Cert Manager Contrib run: | cd client-java-contrib/cert-manager - ../../mvnw clean install \ + mvn clean install \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -q \ -Dmaven.test.skip=true - name: Build Prometheus Contrib run: | cd client-java-contrib/prometheus-operator - ../../mvnw clean install \ + mvn clean install \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -q \ -Dmaven.test.skip=true @@ -143,10 +128,8 @@ jobs: run: | for d in $(find examples* -maxdepth 1 -type d) do - ${MVNW} clean install -Dmaven.test.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + mvn clean install -Dmaven.test.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn done - env: - MVNW: ${{ github.workspace }}/mvnw codegen: runs-on: ubuntu-latest services: @@ -156,7 +139,7 @@ jobs: - 5000:5000 name: CRD Java Models Code Generation steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@1c2f28ccd9476e8a936ac9a1f287405504c93304 # v5 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7763fbcd07..8e64f160a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,11 +6,11 @@ on: releaseVersion: type: string required: true - description: The POM release version of this release. Must be a semantic version of the form X.Y.Z. (For cutting legacy release, use format X.Y.Z-legacy) + description: The POM release version of this release. Must be a semantic version of the form X.Y.Z. nextDevelopmentVersion: type: string required: true - description: The next POM development version after the release is done. Must be of the form X.Y.${Z+1}-SNAPSHOT. (For cutting legacy release, use format X.Y.${Z+1}-legacy-SNAPSHOT) + description: The next POM development version after the release is done. Must be of the form X.Y.${Z+1}-SNAPSHOT dry-run: type: boolean required: true @@ -23,11 +23,11 @@ jobs: - name: Validate Input run: | echo "${{ github.ref_type }}" | perl -ne 'die unless m/^branch$/' - echo "${{ github.ref_name }}" | perl -ne 'die unless m/^release-\d+$/' - echo "${{ github.event.inputs.releaseVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+$/' - echo "${{ github.event.inputs.nextDevelopmentVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+-SNAPSHOT$/' + echo "${{ github.ref_name }}" | perl -ne 'die unless m/^release-legacy-.+$/' + echo "${{ github.event.inputs.releaseVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+-legacy$/' + echo "${{ github.event.inputs.nextDevelopmentVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+-legacy-SNAPSHOT$/' - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: token: ${{ secrets.PAT_TOKEN }} - name: Check Actor @@ -35,7 +35,7 @@ jobs: # Release actor should be in the OWNER list cat OWNERS | grep ${{ github.actor }} - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x @@ -53,7 +53,7 @@ jobs: git config user.name "Kubernetes Publisher" - name: Check Current Version run: | - ./mvnw -q \ + mvn -q \ -Dexec.executable=echo \ -Dexec.args='${project.version}' \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ @@ -87,19 +87,15 @@ jobs: git push https://${{ github.token }}@github.com/${{ github.repository }}.git v${{ github.event.inputs.releaseVersion }} - name: Pull Request if: ${{ github.event.inputs.dry-run != 'true' }} - env: - GH_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - gh pr create \ - --base ${{ github.ref_name }} \ - --head automated-release-${{ github.event.inputs.releaseVersion }} \ - --title "Automated Release: ${{ github.event.inputs.releaseVersion }}" \ - --body "" + uses: repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 # v2 + with: + source_branch: automated-release-${{ github.event.inputs.releaseVersion }} + destination_branch: ${{ github.ref_name }} + github_token: ${{ secrets.PAT_TOKEN }} + pr_title: "Automated Release: ${{ github.event.inputs.releaseVersion }}" - name: Publish Release if: ${{ github.event.inputs.dry-run != 'true' }} - env: - GH_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - gh release create v${{ github.event.inputs.releaseVersion }} \ - --title "v${{ github.event.inputs.releaseVersion }}" \ - --generate-notes + uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1 + with: + token: ${{ secrets.PAT_TOKEN }} + tag: v${{ github.event.inputs.releaseVersion }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 52fe249ac5..95fb6a7b70 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -4,10 +4,6 @@ on: push: branches: - master - paths: - - '**/*.java' - - '**/pom.xml' - - '.github/workflows/snapshot.yml' workflow_dispatch: {} permissions: @@ -19,9 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Java - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: 'temurin' java-version: 17.0.x From d88e6e7fd00f8ec36cbbf09edd4a7218c0e81436 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 20:40:47 +0000 Subject: [PATCH 2/3] chore: update PR description with base branch note Agent-Logs-Url: https://github.com/kubernetes-client/java/sessions/08f7f810-1768-4b14-80b6-d65e39588846 Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com> --- .devcontainer/Dockerfile | 67 + .devcontainer/library-scripts/README.md | 5 + .../library-scripts/common-debian.sh | 123 + .devcontainer/library-scripts/node-debian.sh | 50 + .devcontainer/maven-settings.xml | 6 + .mvn/wrapper/MavenWrapperDownloader.java | 117 + client-java-contrib/Dockerfile.gen | 13 + client-java-contrib/Dockerfile.gen-base | 43 + .../manager/models/V1alpha2Certificate.java | 216 + .../models/V1alpha2CertificateList.java | 192 + .../models/V1alpha2CertificateRequest.java | 218 + .../V1alpha2CertificateRequestList.java | 194 + .../V1alpha2CertificateRequestSpec.java | 328 + .../models/V1alpha2CertificateSpec.java | 886 + .../V1alpha2CertificateSpecPrivateKey.java | 95 + .../V1alpha2CertificateSpecSubject.java | 317 + .../manager/models/V1alpha2Challenge.java | 209 + .../manager/models/V1alpha2ChallengeList.java | 192 + .../manager/models/V1alpha2ClusterIssuer.java | 217 + .../models/V1alpha2ClusterIssuerList.java | 192 + .../cert/manager/models/V1alpha2Issuer.java | 216 + .../manager/models/V1alpha2IssuerList.java | 192 + .../manager/models/V1alpha2IssuerSpec.java | 199 + .../models/V1alpha2IssuerSpecAcme.java | 271 + .../models/V1alpha2IssuerSpecAcmeDns01.java | 412 + .../V1alpha2IssuerSpecAcmeDns01Acmedns.java | 122 + ...rSpecAcmeDns01AcmednsAccountSecretRef.java | 128 + .../V1alpha2IssuerSpecAcmeDns01Akamai.java | 187 + .../V1alpha2IssuerSpecAcmeDns01Azuredns.java | 323 + ...cmeDns01AzurednsClientSecretSecretRef.java | 123 + .../V1alpha2IssuerSpecAcmeDns01Clouddns.java | 153 + ...V1alpha2IssuerSpecAcmeDns01Cloudflare.java | 151 + ...pecAcmeDns01CloudflareApiKeySecretRef.java | 128 + ...cAcmeDns01CloudflareApiTokenSecretRef.java | 123 + ...alpha2IssuerSpecAcmeDns01Digitalocean.java | 89 + .../V1alpha2IssuerSpecAcmeDns01Rfc2136.java | 195 + ...ecAcmeDns01Rfc2136TsigSecretSecretRef.java | 128 + .../V1alpha2IssuerSpecAcmeDns01Route53.java | 219 + ...eDns01Route53SecretAccessKeySecretRef.java | 130 + .../V1alpha2IssuerSpecAcmeDns01Webhook.java | 159 + ...2IssuerSpecAcmeExternalAccountBinding.java | 213 + ...cmeExternalAccountBindingKeySecretRef.java | 131 + .../models/V1alpha2IssuerSpecAcmeHttp01.java | 93 + .../V1alpha2IssuerSpecAcmeHttp01Ingress.java | 218 + ...rSpecAcmeHttp01IngressIngressTemplate.java | 96 + ...eHttp01IngressIngressTemplateMetadata.java | 150 + ...ssuerSpecAcmeHttp01IngressPodTemplate.java | 122 + ...cAcmeHttp01IngressPodTemplateMetadata.java | 147 + ...rSpecAcmeHttp01IngressPodTemplateSpec.java | 185 + ...eHttp01IngressPodTemplateSpecAffinity.java | 158 + ...ssPodTemplateSpecAffinityNodeAffinity.java | 179 + ...ateSpecAffinityNodeAffinityPreference.java | 174 + ...odeAffinityPreferenceMatchExpressions.java | 187 + ...uringSchedulingIgnoredDuringExecution.java | 141 + ...uringSchedulingIgnoredDuringExecution.java | 128 + ...noredDuringExecutionNodeSelectorTerms.java | 185 + ...essPodTemplateSpecAffinityPodAffinity.java | 207 + ...pecAffinityPodAffinityPodAffinityTerm.java | 186 + ...dAffinityPodAffinityTermLabelSelector.java | 175 + ...nityTermLabelSelectorMatchExpressions.java | 186 + ...uringSchedulingIgnoredDuringExecution.java | 142 + ...uringSchedulingIgnoredDuringExecution.java | 198 + ...odTemplateSpecAffinityPodAntiAffinity.java | 208 + ...tp01IngressPodTemplateSpecTolerations.java | 231 + ...pha2IssuerSpecAcmePrivateKeySecretRef.java | 129 + .../V1alpha2IssuerSpecAcmeSelector.java | 194 + .../models/V1alpha2IssuerSpecAcmeSolvers.java | 148 + .../manager/models/V1alpha2IssuerSpecCa.java | 138 + .../models/V1alpha2IssuerSpecSelfSigned.java | 110 + .../models/V1alpha2IssuerSpecVault.java | 183 + .../models/V1alpha2IssuerSpecVaultAuth.java | 144 + .../V1alpha2IssuerSpecVaultAuthAppRole.java | 154 + ...a2IssuerSpecVaultAuthAppRoleSecretRef.java | 128 + ...V1alpha2IssuerSpecVaultAuthKubernetes.java | 157 + ...ssuerSpecVaultAuthKubernetesSecretRef.java | 127 + ...pha2IssuerSpecVaultAuthTokenSecretRef.java | 122 + .../models/V1alpha2IssuerSpecVenafi.java | 151 + .../models/V1alpha2IssuerSpecVenafiCloud.java | 122 + ...ssuerSpecVenafiCloudApiTokenSecretRef.java | 123 + .../models/V1alpha2IssuerSpecVenafiTpp.java | 157 + ...pha2IssuerSpecVenafiTppCredentialsRef.java | 96 + .../manager/models/V1alpha2IssuerStatus.java | 128 + .../models/V1alpha2IssuerStatusAcme.java | 128 + .../V1alpha2IssuerStatusConditions.java | 261 + .../io/cert/manager/models/V1alpha2Order.java | 209 + .../manager/models/V1alpha2OrderList.java | 192 + .../manager/models/V1alpha3Certificate.java | 216 + .../models/V1alpha3CertificateList.java | 192 + .../models/V1alpha3CertificateRequest.java | 218 + .../V1alpha3CertificateRequestList.java | 194 + .../models/V1alpha3CertificateSpec.java | 848 + .../manager/models/V1alpha3Challenge.java | 209 + .../manager/models/V1alpha3ChallengeList.java | 192 + .../manager/models/V1alpha3ChallengeSpec.java | 385 + .../V1alpha3ChallengeSpecIssuerRef.java | 149 + .../models/V1alpha3ChallengeSpecSolver.java | 148 + .../models/V1alpha3ChallengeStatus.java | 248 + .../manager/models/V1alpha3ClusterIssuer.java | 217 + .../models/V1alpha3ClusterIssuerList.java | 192 + .../models/V1alpha3ClusterIssuerSpec.java | 199 + .../models/V1alpha3ClusterIssuerStatus.java | 129 + .../cert/manager/models/V1alpha3Issuer.java | 216 + .../manager/models/V1alpha3IssuerList.java | 192 + .../io/cert/manager/models/V1alpha3Order.java | 209 + .../manager/models/V1alpha3OrderList.java | 192 + .../manager/models/V1alpha3OrderSpec.java | 186 + .../manager/models/V1beta1Certificate.java | 215 + .../models/V1beta1CertificateList.java | 192 + .../models/V1beta1CertificateRequest.java | 217 + .../models/V1beta1CertificateRequestList.java | 193 + .../models/V1beta1CertificateRequestSpec.java | 326 + ...1beta1CertificateRequestSpecIssuerRef.java | 152 + .../V1beta1CertificateRequestStatus.java | 200 + ...ta1CertificateRequestStatusConditions.java | 266 + .../models/V1beta1CertificateSpec.java | 640 + .../V1beta1CertificateSpecIssuerRef.java | 151 + .../V1beta1CertificateSpecKeystores.java | 121 + .../V1beta1CertificateSpecKeystoresJks.java | 128 + ...cateSpecKeystoresJksPasswordSecretRef.java | 128 + ...V1beta1CertificateSpecKeystoresPkcs12.java | 128 + ...eSpecKeystoresPkcs12PasswordSecretRef.java | 128 + .../V1beta1CertificateSpecPrivateKey.java | 303 + .../models/V1beta1CertificateSpecSubject.java | 353 + .../models/V1beta1CertificateStatus.java | 308 + .../V1beta1CertificateStatusConditions.java | 263 + .../cert/manager/models/V1beta1Challenge.java | 208 + .../manager/models/V1beta1ChallengeList.java | 192 + .../manager/models/V1beta1ChallengeSpec.java | 385 + .../models/V1beta1ChallengeSpecIssuerRef.java | 148 + .../models/V1beta1ChallengeSpecSolver.java | 147 + .../V1beta1ChallengeSpecSolverDns01.java | 414 + .../models/V1beta1ChallengeStatus.java | 247 + .../manager/models/V1beta1ClusterIssuer.java | 216 + .../models/V1beta1ClusterIssuerList.java | 192 + .../models/V1beta1ClusterIssuerSpec.java | 199 + .../io/cert/manager/models/V1beta1Issuer.java | 215 + .../manager/models/V1beta1IssuerList.java | 192 + .../manager/models/V1beta1IssuerSpec.java | 199 + .../manager/models/V1beta1IssuerSpecAcme.java | 270 + .../models/V1beta1IssuerSpecAcmeSolvers.java | 148 + .../io/cert/manager/models/V1beta1Order.java | 208 + .../cert/manager/models/V1beta1OrderList.java | 192 + .../cert/manager/models/V1beta1OrderSpec.java | 186 + .../models/V1beta1OrderSpecIssuerRef.java | 148 + .../manager/models/V1beta1OrderStatus.java | 353 + .../V1beta1OrderStatusAuthorizations.java | 303 + .../models/V1beta1OrderStatusChallenges.java | 159 + .../client/e2e/basic/CoreV1ApiTest.groovy | 39 + .../kubernetes/client/e2e/csr/CSRTest.groovy | 66 + .../client/e2e/dynamic/DynamicApiTest.groovy | 38 + .../e2e/informer/NamespaceInformerTest.groovy | 51 + .../e2e/kubectl/KubectlDrainTest.groovy | 61 + .../e2e/kubectl/KubectlNamespaceTest.groovy | 85 + .../e2e/kubectl/KubectlRolloutTest.groovy | 216 + .../client/e2e/util/ModelMapperTest.groovy | 46 + examples/examples-release-16/Dockerfile | 7 + examples/examples-release-16/README.md | 13 + examples/examples-release-16/createPod.sh | 26 + examples/examples-release-16/pom.xml | 118 + .../client/examples/AttachExample.java | 77 + .../client/examples/CertManagerExample.java | 45 + .../client/examples/ControllerExample.java | 163 + .../client/examples/CopyExample.java | 51 + .../client/examples/DynamicClientExample.java | 42 + .../kubernetes/client/examples/Example.java | 44 + .../client/examples/ExecExample.java | 96 + .../client/examples/ExpandedExample.java | 274 + .../client/examples/FluentExample.java | 75 + .../client/examples/GenericClientExample.java | 63 + .../examples/InClusterClientExample.java | 58 + .../client/examples/InformerExample.java | 106 + .../examples/KubeConfigFileClientExample.java | 58 + .../client/examples/KubectlExample.java | 311 + .../examples/LeaderElectionExample.java | 56 + .../client/examples/LogsExample.java | 51 + .../client/examples/MetricsExample.java | 68 + .../client/examples/PagerExample.java | 72 + .../client/examples/ParseExample.java | 64 + .../client/examples/PatchExample.java | 129 + .../client/examples/PortForwardExample.java | 87 + .../client/examples/PromOpExample.java | 43 + .../client/examples/PrometheusExample.java | 66 + .../client/examples/ProtoExample.java | 69 + .../examples/SpringControllerExample.java | 147 + .../examples/SpringLoadBalancerExample.java | 68 + .../client/examples/WatchExample.java | 54 + .../client/examples/WebSocketsExample.java | 74 + .../client/examples/YamlExample.java | 109 + .../src/main/resources/application.properties | 2 + .../client/examples/ExampleTest.java | 55 + examples/examples-release-16/test-svc.yaml | 11 + examples/examples-release-16/test.yaml | 16 + examples/examples-release-17/Dockerfile | 7 + examples/examples-release-17/README.md | 13 + examples/examples-release-17/createPod.sh | 26 + examples/examples-release-17/pom.xml | 118 + .../client/examples/AttachExample.java | 77 + .../client/examples/CertManagerExample.java | 45 + .../client/examples/ControllerExample.java | 163 + .../client/examples/CopyExample.java | 51 + .../client/examples/DynamicClientExample.java | 42 + .../kubernetes/client/examples/Example.java | 44 + .../client/examples/ExecExample.java | 96 + .../client/examples/ExpandedExample.java | 274 + .../client/examples/FluentExample.java | 75 + .../client/examples/GenericClientExample.java | 63 + .../examples/InClusterClientExample.java | 58 + .../client/examples/InformerExample.java | 106 + .../examples/KubeConfigFileClientExample.java | 58 + .../client/examples/KubectlExample.java | 311 + .../examples/LeaderElectionExample.java | 56 + .../client/examples/LogsExample.java | 51 + .../client/examples/MetricsExample.java | 68 + .../client/examples/PagerExample.java | 72 + .../client/examples/ParseExample.java | 64 + .../client/examples/PatchExample.java | 129 + .../client/examples/PortForwardExample.java | 87 + .../client/examples/PromOpExample.java | 43 + .../client/examples/PrometheusExample.java | 66 + .../client/examples/ProtoExample.java | 69 + .../examples/SpringControllerExample.java | 147 + .../examples/SpringLoadBalancerExample.java | 68 + .../client/examples/WatchExample.java | 54 + .../client/examples/WebSocketsExample.java | 74 + .../client/examples/YamlExample.java | 109 + .../src/main/resources/application.properties | 2 + .../client/examples/ExampleTest.java | 55 + examples/examples-release-17/test-svc.yaml | 11 + examples/examples-release-17/test.yaml | 16 + examples/examples-release-18/Dockerfile | 7 + examples/examples-release-18/README.md | 13 + examples/examples-release-18/createPod.sh | 26 + examples/examples-release-18/pom.xml | 118 + .../client/examples/AttachExample.java | 77 + .../client/examples/CertManagerExample.java | 45 + .../client/examples/ControllerExample.java | 163 + .../client/examples/CopyExample.java | 51 + .../examples/DeployRolloutRestartExample.java | 140 + .../client/examples/DynamicClientExample.java | 42 + .../kubernetes/client/examples/Example.java | 44 + .../client/examples/ExecExample.java | 96 + .../client/examples/ExpandedExample.java | 274 + .../client/examples/FluentExample.java | 75 + .../client/examples/GenericClientExample.java | 63 + .../examples/InClusterClientExample.java | 58 + .../client/examples/InformerExample.java | 106 + .../examples/KubeConfigFileClientExample.java | 58 + .../client/examples/KubectlExample.java | 311 + .../examples/LeaderElectionExample.java | 56 + .../client/examples/LogsExample.java | 51 + .../client/examples/MetricsExample.java | 68 + .../client/examples/PagerExample.java | 72 + .../client/examples/ParseExample.java | 64 + .../client/examples/PatchExample.java | 130 + .../client/examples/PortForwardExample.java | 87 + .../client/examples/PromOpExample.java | 43 + .../client/examples/PrometheusExample.java | 66 + .../client/examples/ProtoExample.java | 69 + .../examples/SpringControllerExample.java | 147 + .../examples/SpringLoadBalancerExample.java | 68 + .../client/examples/WatchExample.java | 54 + .../client/examples/WebSocketsExample.java | 74 + .../client/examples/YamlExample.java | 109 + .../src/main/resources/application.properties | 2 + .../client/examples/ExampleTest.java | 55 + examples/examples-release-18/test-svc.yaml | 11 + examples/examples-release-18/test.yaml | 16 + examples/examples-release-19/Dockerfile | 7 + examples/examples-release-19/README.md | 13 + examples/examples-release-19/createPod.sh | 26 + examples/examples-release-19/pom.xml | 110 + .../client/examples/AttachExample.java | 77 + .../client/examples/CertManagerExample.java | 45 + .../client/examples/ControllerExample.java | 164 + .../client/examples/CopyExample.java | 51 + .../examples/DeployRolloutRestartExample.java | 140 + .../client/examples/DynamicClientExample.java | 42 + .../examples/EKSAuthenticationExample.java | 53 + .../kubernetes/client/examples/Example.java | 44 + .../client/examples/ExecExample.java | 96 + .../client/examples/ExpandedExample.java | 278 + .../client/examples/FluentExample.java | 75 + .../client/examples/GenericClientExample.java | 63 + .../examples/InClusterClientExample.java | 58 + .../client/examples/InformerExample.java | 107 + .../examples/KubeConfigFileClientExample.java | 58 + .../client/examples/KubectlExample.java | 311 + .../examples/LeaderElectionExample.java | 56 + .../client/examples/LogsExample.java | 51 + .../client/examples/MetricsExample.java | 68 + .../client/examples/PagerExample.java | 73 + .../client/examples/ParseExample.java | 64 + .../client/examples/PatchExample.java | 130 + .../client/examples/PortForwardExample.java | 87 + .../client/examples/PromOpExample.java | 43 + .../client/examples/PrometheusExample.java | 66 + .../client/examples/ProtoExample.java | 69 + .../examples/SpringControllerExample.java | 147 + .../examples/SpringLoadBalancerExample.java | 68 + .../client/examples/WatchExample.java | 54 + .../client/examples/WebSocketsExample.java | 74 + .../client/examples/YamlExample.java | 110 + .../src/main/resources/application.properties | 2 + .../client/examples/ExampleTest.java | 55 + examples/examples-release-19/test-svc.yaml | 11 + examples/examples-release-19/test.yaml | 16 + .../V1alpha1GroupVersionResourceBuilder.java | 34 + .../V1alpha1GroupVersionResourceFluent.java | 122 + .../V1alpha1MigrationConditionBuilder.java | 36 + .../V1alpha1MigrationConditionFluent.java | 169 + .../V1alpha1PodCertificateRequestBuilder.java | 36 + .../V1alpha1PodCertificateRequestFluent.java | 298 + ...lpha1PodCertificateRequestListBuilder.java | 35 + ...alpha1PodCertificateRequestListFluent.java | 408 + ...lpha1PodCertificateRequestSpecBuilder.java | 41 + ...alpha1PodCertificateRequestSpecFluent.java | 434 + ...ha1PodCertificateRequestStatusBuilder.java | 36 + ...pha1PodCertificateRequestStatusFluent.java | 388 + ...1alpha1StorageVersionMigrationBuilder.java | 36 + ...V1alpha1StorageVersionMigrationFluent.java | 298 + ...ha1StorageVersionMigrationListBuilder.java | 35 + ...pha1StorageVersionMigrationListFluent.java | 408 + ...ha1StorageVersionMigrationSpecBuilder.java | 33 + ...pha1StorageVersionMigrationSpecFluent.java | 143 + ...1StorageVersionMigrationStatusBuilder.java | 33 + ...a1StorageVersionMigrationStatusFluent.java | 318 + .../V1alpha1VolumeAttributesClassBuilder.java | 36 + .../V1alpha1VolumeAttributesClassFluent.java | 262 + ...lpha1VolumeAttributesClassListBuilder.java | 35 + ...alpha1VolumeAttributesClassListFluent.java | 408 + .../V1alpha3CELDeviceSelectorBuilder.java | 32 + .../V1alpha3CELDeviceSelectorFluent.java | 76 + .../models/V1alpha3DeviceSelectorBuilder.java | 32 + .../models/V1alpha3DeviceSelectorFluent.java | 120 + kubernetes/docs/StorageV1alpha1Api.md | 671 + .../docs/StoragemigrationV1alpha1Api.md | 910 + .../docs/V1alpha1GroupVersionResource.md | 15 + kubernetes/docs/V1alpha1MigrationCondition.md | 17 + .../docs/V1alpha1PodCertificateRequest.md | 21 + .../docs/V1alpha1PodCertificateRequestList.md | 20 + .../docs/V1alpha1PodCertificateRequestSpec.md | 22 + .../V1alpha1PodCertificateRequestStatus.md | 17 + .../docs/V1alpha1StorageVersionMigration.md | 21 + .../V1alpha1StorageVersionMigrationList.md | 20 + .../V1alpha1StorageVersionMigrationSpec.md | 14 + .../V1alpha1StorageVersionMigrationStatus.md | 14 + .../docs/V1alpha1VolumeAttributesClass.md | 21 + .../docs/V1alpha1VolumeAttributesClassList.md | 20 + kubernetes/docs/V1alpha3CELDeviceSelector.md | 13 + kubernetes/docs/V1alpha3DeviceSelector.md | 13 + .../openapi/apis/StorageV1alpha1Api.java | 1356 ++ .../apis/StoragemigrationV1alpha1Api.java | 1807 ++ .../models/V1alpha1GroupVersionResource.java | 156 + .../models/V1alpha1MigrationCondition.java | 213 + .../models/V1alpha1PodCertificateRequest.java | 216 + .../V1alpha1PodCertificateRequestList.java | 193 + .../V1alpha1PodCertificateRequestSpec.java | 350 + .../V1alpha1PodCertificateRequestStatus.java | 226 + .../V1alpha1StorageVersionMigration.java | 217 + .../V1alpha1StorageVersionMigrationList.java | 193 + .../V1alpha1StorageVersionMigrationSpec.java | 127 + ...V1alpha1StorageVersionMigrationStatus.java | 138 + .../models/V1alpha1VolumeAttributesClass.java | 225 + .../V1alpha1VolumeAttributesClassList.java | 193 + .../models/V1alpha3CELDeviceSelector.java | 97 + .../models/V1alpha3DeviceSelector.java | 99 + .../client/proto/V1alpha1Admission.java | 5194 ++++++ .../proto/V1alpha1Admissionregistration.java | 14647 ++++++++++++++++ .../client/proto/V1alpha1Settings.java | 5571 ++++++ .../client/proto/V2alpha1Batch.java | 8443 +++++++++ .../AzureActiveDirectoryAuthenticator.java | 84 + .../client/util/eks/AWS4STSSigner.java | 141 + .../client/util/eks/AWS4SignerBase.java | 256 + .../client/util/eks/BinaryUtils.java | 65 + .../kubernetes/client/util/eks/HttpUtils.java | 121 + 375 files changed, 87641 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/library-scripts/README.md create mode 100755 .devcontainer/library-scripts/common-debian.sh create mode 100644 .devcontainer/library-scripts/node-debian.sh create mode 100644 .devcontainer/maven-settings.xml create mode 100644 .mvn/wrapper/MavenWrapperDownloader.java create mode 100644 client-java-contrib/Dockerfile.gen create mode 100644 client-java-contrib/Dockerfile.gen-base create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java create mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy create mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy create mode 100644 examples/examples-release-16/Dockerfile create mode 100644 examples/examples-release-16/README.md create mode 100755 examples/examples-release-16/createPod.sh create mode 100644 examples/examples-release-16/pom.xml create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java create mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java create mode 100644 examples/examples-release-16/src/main/resources/application.properties create mode 100644 examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java create mode 100644 examples/examples-release-16/test-svc.yaml create mode 100644 examples/examples-release-16/test.yaml create mode 100644 examples/examples-release-17/Dockerfile create mode 100644 examples/examples-release-17/README.md create mode 100755 examples/examples-release-17/createPod.sh create mode 100644 examples/examples-release-17/pom.xml create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java create mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java create mode 100644 examples/examples-release-17/src/main/resources/application.properties create mode 100644 examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java create mode 100644 examples/examples-release-17/test-svc.yaml create mode 100644 examples/examples-release-17/test.yaml create mode 100644 examples/examples-release-18/Dockerfile create mode 100644 examples/examples-release-18/README.md create mode 100755 examples/examples-release-18/createPod.sh create mode 100644 examples/examples-release-18/pom.xml create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java create mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java create mode 100644 examples/examples-release-18/src/main/resources/application.properties create mode 100644 examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java create mode 100644 examples/examples-release-18/test-svc.yaml create mode 100644 examples/examples-release-18/test.yaml create mode 100644 examples/examples-release-19/Dockerfile create mode 100644 examples/examples-release-19/README.md create mode 100755 examples/examples-release-19/createPod.sh create mode 100644 examples/examples-release-19/pom.xml create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java create mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java create mode 100644 examples/examples-release-19/src/main/resources/application.properties create mode 100644 examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java create mode 100644 examples/examples-release-19/test-svc.yaml create mode 100644 examples/examples-release-19/test.yaml create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java create mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java create mode 100644 kubernetes/docs/StorageV1alpha1Api.md create mode 100644 kubernetes/docs/StoragemigrationV1alpha1Api.md create mode 100644 kubernetes/docs/V1alpha1GroupVersionResource.md create mode 100644 kubernetes/docs/V1alpha1MigrationCondition.md create mode 100644 kubernetes/docs/V1alpha1PodCertificateRequest.md create mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestList.md create mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestSpec.md create mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestStatus.md create mode 100644 kubernetes/docs/V1alpha1StorageVersionMigration.md create mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationList.md create mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md create mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md create mode 100644 kubernetes/docs/V1alpha1VolumeAttributesClass.md create mode 100644 kubernetes/docs/V1alpha1VolumeAttributesClassList.md create mode 100644 kubernetes/docs/V1alpha3CELDeviceSelector.md create mode 100644 kubernetes/docs/V1alpha3DeviceSelector.md create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java create mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java create mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java create mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java create mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java create mode 100644 proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java create mode 100644 util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java create mode 100644 util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java create mode 100644 util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java create mode 100644 util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java create mode 100644 util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..63180e09f3 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,67 @@ +# Update the VARIANT arg in devcontainer.json to pick a Java version >= 11 +ARG VARIANT=11 +FROM openjdk:${VARIANT}-jdk-buster + +# Options for setup script +ARG INSTALL_ZSH="true" +ARG UPGRADE_PACKAGES="false" +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. +COPY library-scripts/*.sh /tmp/library-scripts/ +RUN apt-get update \ + && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts + +# [Optional] Install Maven +ARG INSTALL_MAVEN="false" +ARG MAVEN_VERSION=3.6.3 +ARG MAVEN_DOWNLOAD_SHA="dev-mode" +ENV MAVEN_HOME /usr/share/maven \ + MAVEN_CONFIG /root/.m2 +COPY maven-settings.xml /usr/share/maven/ref/ +RUN if [ "${INSTALL_MAVEN}" = "true" ]; then \ + mkdir -p /usr/share/maven /usr/share/maven/ref \ + && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ + && ([ "${MAVEN_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${MAVEN_DOWNLOAD_SHA} */tmp/apache-maven.tar.gz" | sha512sum -c - ) \ + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ + && rm -f /tmp/apache-maven.tar.gz \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn; \ + fi + +# [Optional] Install Gradle +ARG INSTALL_GRADLE="false" +ARG GRADLE_VERSION=5.4.1 +ARG GRADLE_DOWNLOAD_SHA="dev-mode" +ENV GRADLE_HOME=/opt/gradle +RUN if [ "${INSTALL_GRADLE}" = "true" ]; then \ + curl -sSL --output gradle.zip "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \ + && ([ "${GRADLE_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${GRADLE_DOWNLOAD_SHA} *gradle.zip" | sha256sum --check - ) \ + && unzip gradle.zip \ + && rm gradle.zip \ + && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ + && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle; \ + fi + +# Allow for a consistant java home location for settings - image is changing over time +RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi + +# [Optional] Install Node.js for use with web applications - update the INSTALL_NODE arg in devcontainer.json to enable. +ARG INSTALL_NODE="false" +ARG NODE_VERSION="lts/*" +ENV NVM_DIR=/usr/local/share/nvm \ + NVM_SYMLINK_CURRENT=true \ + PATH=${NVM_DIR}/current/bin:${PATH} +COPY library-scripts/node-debian.sh /tmp/library-scripts/ +RUN if [ "$INSTALL_NODE" = "true" ]; then \ + /bin/bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ + fi \ + && rm -rf /tmp/library-scripts + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update \ +# && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends \ No newline at end of file diff --git a/.devcontainer/library-scripts/README.md b/.devcontainer/library-scripts/README.md new file mode 100644 index 0000000000..d06dfd1a95 --- /dev/null +++ b/.devcontainer/library-scripts/README.md @@ -0,0 +1,5 @@ +# Warning: Folder contents may be replaced + +The contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged. + +To retain your edits, move the file to a different location. You may also delete the files if they are not needed. \ No newline at end of file diff --git a/.devcontainer/library-scripts/common-debian.sh b/.devcontainer/library-scripts/common-debian.sh new file mode 100755 index 0000000000..ffef7ba2d4 --- /dev/null +++ b/.devcontainer/library-scripts/common-debian.sh @@ -0,0 +1,123 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- + +# Syntax: ./common-debian.sh + +set -e + +INSTALL_ZSH=${1:-"true"} +USERNAME=${2:-"$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)"} +USER_UID=${3:-1000} +USER_GID=${4:-1000} +UPGRADE_PACKAGES=${5:-"true"} + +if [ "$(id -u)" -ne 0 ]; then + echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' + exit 1 +fi + +# Treat a user name of "none" as root +if [ "${USERNAME}" = "none" ] || [ "${USERNAME}" = "root" ]; then + USERNAME=root + USER_UID=0 + USER_GID=0 +fi + +# Ensure apt is in non-interactive to avoid prompts +export DEBIAN_FRONTEND=noninteractive + +# Install apt-utils to avoid debconf warning +apt-get -y install --no-install-recommends apt-utils 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 ) + +# Get to latest versions of all packages +if [ "${UPGRADE_PACKAGES}" = "true" ]; then + apt-get -y upgrade --no-install-recommends +fi + +# Install common developer tools and dependencies +apt-get -y install --no-install-recommends \ + git \ + openssh-client \ + less \ + iproute2 \ + procps \ + curl \ + wget \ + unzip \ + nano \ + jq \ + lsb-release \ + ca-certificates \ + apt-transport-https \ + dialog \ + gnupg2 \ + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + libicu[0-9][0-9] \ + liblttng-ust0 \ + libstdc++6 \ + zlib1g \ + locales + +# Ensure at least the en_US.UTF-8 UTF-8 locale is available. +# Common need for both applications and things like the agnoster ZSH theme. +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +locale-gen + +# Install libssl1.1 if available +if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then + apt-get -y install --no-install-recommends libssl1.1 +fi + +# Install appropriate version of libssl1.0.x if available +LIBSSL=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '') +if [ "$(echo "$LIBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then + if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then + # Debian 9 + apt-get -y install --no-install-recommends libssl1.0.2 + elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then + # Ubuntu 18.04, 16.04, earlier + apt-get -y install --no-install-recommends libssl1.0.0 + fi +fi + +# Create or update a non-root user to match UID/GID - see https://aka.ms/vscode-remote/containers/non-root-user. +if id -u $USERNAME > /dev/null 2>&1; then + # User exists, update if needed + if [ "$USER_GID" != "$(id -G $USERNAME)" ]; then + groupmod --gid $USER_GID $USERNAME + usermod --gid $USER_GID $USERNAME + fi + if [ "$USER_UID" != "$(id -u $USERNAME)" ]; then + usermod --uid $USER_UID $USERNAME + fi +else + # Create user + groupadd --gid $USER_GID $USERNAME + useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME +fi + +# Add add sudo support for non-root user +apt-get install -y sudo +echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME +chmod 0440 /etc/sudoers.d/$USERNAME + +# Ensure ~/.local/bin is in the PATH for root and non-root users for bash. (zsh is later) +echo "export PATH=\$PATH:\$HOME/.local/bin" | tee -a /root/.bashrc >> /home/$USERNAME/.bashrc +chown $USER_UID:$USER_GID /home/$USERNAME/.bashrc + +# Optionally install and configure zsh +if [ "$INSTALL_ZSH" = "true" ] && [ ! -d "/root/.oh-my-zsh" ]; then + apt-get install -y zsh + sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + echo "export PATH=\$PATH:\$HOME/.local/bin" >> /root/.zshrc + cp -R /root/.oh-my-zsh /home/$USERNAME + cp /root/.zshrc /home/$USERNAME + sed -i -e "s/\/root\/.oh-my-zsh/\/home\/$USERNAME\/.oh-my-zsh/g" /home/$USERNAME/.zshrc + chown -R $USER_UID:$USER_GID /home/$USERNAME/.oh-my-zsh /home/$USERNAME/.zshrc +fi + diff --git a/.devcontainer/library-scripts/node-debian.sh b/.devcontainer/library-scripts/node-debian.sh new file mode 100644 index 0000000000..306fcd0120 --- /dev/null +++ b/.devcontainer/library-scripts/node-debian.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- + +# Syntax: ./node-debian.sh + +set -e + +export NVM_DIR=${1:-"/usr/local/share/nvm"} +export NODE_VERSION=${2:-"lts/*"} +NONROOT_USER=${3:-"vscode"} + +if [ "$(id -u)" -ne 0 ]; then + echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' + exit 1 +fi + +# Ensure apt is in non-interactive to avoid prompts +export DEBIAN_FRONTEND=noninteractive + +if [ "${NODE_VERSION}" = "none" ]; then + export NODE_VERSION= +fi + +# Install NVM +mkdir -p ${NVM_DIR} +curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 2>&1 +if [ "${NODE_VERSION}" != "" ]; then + /bin/bash -c "source $NVM_DIR/nvm.sh && nvm alias default ${NODE_VERSION}" 2>&1 +fi + +echo -e "export NVM_DIR=\"${NVM_DIR}\"\n\ +[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\"\n\ +[ -s \"\$NVM_DIR/bash_completion\" ] && \\. \"\$NVM_DIR/bash_completion\"" \ +| tee -a /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc >> /root/.zshrc + +echo -e "if [ \"\$(stat -c '%U' \$NVM_DIR)\" != \"${NONROOT_USER}\" ]; then\n\ + sudo chown -R ${NONROOT_USER}:root \$NVM_DIR\n\ +fi" | tee -a /root/.bashrc /root/.zshrc /home/${NONROOT_USER}/.bashrc >> /home/${NONROOT_USER}/.zshrc + +chown ${NONROOT_USER}:${NONROOT_USER} /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc +chown -R ${NONROOT_USER}:root ${NVM_DIR} + +# Install yarn +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 2>/dev/null +echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +apt-get update +apt-get -y install --no-install-recommends yarn diff --git a/.devcontainer/maven-settings.xml b/.devcontainer/maven-settings.xml new file mode 100644 index 0000000000..50439abb02 --- /dev/null +++ b/.devcontainer/maven-settings.xml @@ -0,0 +1,6 @@ + + /usr/share/maven/ref/repository + \ No newline at end of file diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..b901097f2d --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/client-java-contrib/Dockerfile.gen b/client-java-contrib/Dockerfile.gen new file mode 100644 index 0000000000..f4959ca932 --- /dev/null +++ b/client-java-contrib/Dockerfile.gen @@ -0,0 +1,13 @@ +ARG BASE_IMAGE=ghcr.io/yue9944882/crd-model-gen-base:v1.0.0 +FROM ${BASE_IMAGE} +# TODO: move this to kubernetes-client group after the permission issue fixed + +ARG GENERATION_XML_FILE + +# Copy required files +COPY openapi-generator/generate_client_in_container.sh /generate_client.sh +COPY preprocess_spec.py / +COPY custom_objects_spec.json / +COPY ${GENERATION_XML_FILE} /generation_params.xml + +ENTRYPOINT ["mvn-entrypoint.sh", "/generate_client.sh"] diff --git a/client-java-contrib/Dockerfile.gen-base b/client-java-contrib/Dockerfile.gen-base new file mode 100644 index 0000000000..2dd1af9b4e --- /dev/null +++ b/client-java-contrib/Dockerfile.gen-base @@ -0,0 +1,43 @@ +FROM maven:3.5-jdk-8-slim + +ARG OPENAPI_GENERATOR_COMMIT +ARG OPENAPI_GENERATOR_USER_ORG=OpenAPITools + +# Install preprocessing script requirements +RUN apt-get update && apt-get -y install git python-pip && pip install urllib3==1.24.2 + +# Install Autorest +RUN apt-get update && apt-get -qq -y install libunwind8 libicu57 libssl1.0 liblttng-ust0 libcurl3 libuuid1 libkrb5-3 zlib1g gnupg2 +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN apt-get update && apt-get -y install \ + nodejs \ + libunwind8-dev \ + && rm -rf /var/lib/apt/lists/* + +RUN npm install -g autorest@3 + +# Check out specific commit of openapi-generator +RUN mkdir /source && \ + cd /source && \ + git clone -n https://github.com/${OPENAPI_GENERATOR_USER_ORG}/openapi-generator.git && \ + cd openapi-generator && \ + git checkout $OPENAPI_GENERATOR_COMMIT + +# Build it and persist local repository +RUN mkdir /.npm && chmod -R go+rwx /.npm && chmod -R go+rwx /root && umask 0 && cd /source/openapi-generator && \ + mvn install -DskipTests -Dmaven.test.skip=true -pl modules/openapi-generator-maven-plugin -am && \ + cp -r /root/.m2/* /usr/share/maven/ref + +RUN mkdir -p /node_modules && chmod -R go+rwx /node_modules +RUN npm install @microsoft.azure/autorest.csharp \ + @microsoft.azure/autorest.modeler + +RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg +RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ +RUN curl https://packages.microsoft.com/config/debian/9/prod.list > prod.list +RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list +RUN chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg +RUN chown root:root /etc/apt/sources.list.d/microsoft-prod.list + +RUN apt-get update +RUN apt-get install -yy -q dotnet-hosting-2.0.8 \ No newline at end of file diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java new file mode 100644 index 0000000000..1f8bd203ca --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A Certificate resource should be created to ensure an up to date and signed x509 certificate is + * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored + * certificate will be renewed before it expires (as configured by `spec.renewBefore`). + */ +@ApiModel( + description = + "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2Certificate implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2CertificateSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateStatus status; + + public V1alpha2Certificate apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2Certificate kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2Certificate metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2Certificate spec(V1alpha2CertificateSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2CertificateSpec spec) { + this.spec = spec; + } + + public V1alpha2Certificate status(V1beta1CertificateStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2Certificate v1alpha2Certificate = (V1alpha2Certificate) o; + return Objects.equals(this.apiVersion, v1alpha2Certificate.apiVersion) + && Objects.equals(this.kind, v1alpha2Certificate.kind) + && Objects.equals(this.metadata, v1alpha2Certificate.metadata) + && Objects.equals(this.spec, v1alpha2Certificate.spec) + && Objects.equals(this.status, v1alpha2Certificate.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2Certificate {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java new file mode 100644 index 0000000000..26a58fb11e --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateList is a list of Certificate */ +@ApiModel(description = "CertificateList is a list of Certificate") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2CertificateList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2CertificateList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2CertificateList addItemsItem(V1alpha2Certificate itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificates. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2CertificateList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2CertificateList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateList v1alpha2CertificateList = (V1alpha2CertificateList) o; + return Objects.equals(this.apiVersion, v1alpha2CertificateList.apiVersion) + && Objects.equals(this.items, v1alpha2CertificateList.items) + && Objects.equals(this.kind, v1alpha2CertificateList.kind) + && Objects.equals(this.metadata, v1alpha2CertificateList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java new file mode 100644 index 0000000000..fbc0ba0728 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java @@ -0,0 +1,218 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A CertificateRequest is used to request a signed certificate from one of the configured issuers. + * All fields within the CertificateRequest's `spec` are immutable after creation. A + * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. + * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in + * time request for a certificate and cannot be re-used. + */ +@ApiModel( + description = + "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateRequest implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2CertificateRequestSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateRequestStatus status; + + public V1alpha2CertificateRequest apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2CertificateRequest kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2CertificateRequest metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2CertificateRequest spec(V1alpha2CertificateRequestSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateRequestSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2CertificateRequestSpec spec) { + this.spec = spec; + } + + public V1alpha2CertificateRequest status(V1beta1CertificateRequestStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateRequestStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateRequestStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateRequest v1alpha2CertificateRequest = (V1alpha2CertificateRequest) o; + return Objects.equals(this.apiVersion, v1alpha2CertificateRequest.apiVersion) + && Objects.equals(this.kind, v1alpha2CertificateRequest.kind) + && Objects.equals(this.metadata, v1alpha2CertificateRequest.metadata) + && Objects.equals(this.spec, v1alpha2CertificateRequest.spec) + && Objects.equals(this.status, v1alpha2CertificateRequest.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateRequest {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java new file mode 100644 index 0000000000..2b32c2d267 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateRequestList is a list of CertificateRequest */ +@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateRequestList + implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2CertificateRequestList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2CertificateRequestList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2CertificateRequestList addItemsItem(V1alpha2CertificateRequest itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificaterequests. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2CertificateRequestList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2CertificateRequestList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateRequestList v1alpha2CertificateRequestList = + (V1alpha2CertificateRequestList) o; + return Objects.equals(this.apiVersion, v1alpha2CertificateRequestList.apiVersion) + && Objects.equals(this.items, v1alpha2CertificateRequestList.items) + && Objects.equals(this.kind, v1alpha2CertificateRequestList.kind) + && Objects.equals(this.metadata, v1alpha2CertificateRequestList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateRequestList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java new file mode 100644 index 0000000000..2a731ad9da --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java @@ -0,0 +1,328 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** Desired state of the CertificateRequest resource. */ +@ApiModel(description = "Desired state of the CertificateRequest resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateRequestSpec { + public static final String SERIALIZED_NAME_CSR = "csr"; + + @SerializedName(SERIALIZED_NAME_CSR) + private byte[] csr; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_IS_C_A = "isCA"; + + @SerializedName(SERIALIZED_NAME_IS_C_A) + private Boolean isCA; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1CertificateRequestSpecIssuerRef issuerRef; + + /** + * KeyUsage specifies valid usage contexts for keys. See: + * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: + * \"signing\", \"digital signature\", \"content commitment\", + * \"key encipherment\", \"key agreement\", \"data encipherment\", + * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher + * only\", \"any\", \"server auth\", \"client auth\", + * \"code signing\", \"email protection\", \"s/mime\", \"ipsec + * end system\", \"ipsec tunnel\", \"ipsec user\", + * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", + * \"netscape sgc\" + */ + @JsonAdapter(UsagesEnum.Adapter.class) + public enum UsagesEnum { + SIGNING("signing"), + + DIGITAL_SIGNATURE("digital signature"), + + CONTENT_COMMITMENT("content commitment"), + + KEY_ENCIPHERMENT("key encipherment"), + + KEY_AGREEMENT("key agreement"), + + DATA_ENCIPHERMENT("data encipherment"), + + CERT_SIGN("cert sign"), + + CRL_SIGN("crl sign"), + + ENCIPHER_ONLY("encipher only"), + + DECIPHER_ONLY("decipher only"), + + ANY("any"), + + SERVER_AUTH("server auth"), + + CLIENT_AUTH("client auth"), + + CODE_SIGNING("code signing"), + + EMAIL_PROTECTION("email protection"), + + S_MIME("s/mime"), + + IPSEC_END_SYSTEM("ipsec end system"), + + IPSEC_TUNNEL("ipsec tunnel"), + + IPSEC_USER("ipsec user"), + + TIMESTAMPING("timestamping"), + + OCSP_SIGNING("ocsp signing"), + + MICROSOFT_SGC("microsoft sgc"), + + NETSCAPE_SGC("netscape sgc"); + + private String value; + + UsagesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsagesEnum fromValue(String value) { + for (UsagesEnum b : UsagesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsagesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsagesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_USAGES = "usages"; + + @SerializedName(SERIALIZED_NAME_USAGES) + private List usages = null; + + public V1alpha2CertificateRequestSpec csr(byte[] csr) { + + this.csr = csr; + return this; + } + + /** + * The PEM-encoded x509 certificate signing request to be submitted to the CA for signing. + * + * @return csr + */ + @ApiModelProperty( + required = true, + value = + "The PEM-encoded x509 certificate signing request to be submitted to the CA for signing.") + public byte[] getCsr() { + return csr; + } + + public void setCsr(byte[] csr) { + this.csr = csr; + } + + public V1alpha2CertificateRequestSpec duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be + * ignored/overridden by some issuer types. + * + * @return duration + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types.") + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public V1alpha2CertificateRequestSpec isCA(Boolean isCA) { + + this.isCA = isCA; + return this; + } + + /** + * IsCA will request to mark the certificate as valid for certificate signing when submitting to + * the issuer. This will automatically add the `cert sign` usage to the list of + * `usages`. + * + * @return isCA + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IsCA will request to mark the certificate as valid for certificate signing when submitting to the issuer. This will automatically add the `cert sign` usage to the list of `usages`.") + public Boolean getIsCA() { + return isCA; + } + + public void setIsCA(Boolean isCA) { + this.isCA = isCA; + } + + public V1alpha2CertificateRequestSpec issuerRef( + V1beta1CertificateRequestSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateRequestSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1alpha2CertificateRequestSpec usages(List usages) { + + this.usages = usages; + return this; + } + + public V1alpha2CertificateRequestSpec addUsagesItem(UsagesEnum usagesItem) { + if (this.usages == null) { + this.usages = new ArrayList(); + } + this.usages.add(usagesItem); + return this; + } + + /** + * Usages is the set of x509 usages that are requested for the certificate. Defaults to + * `digital signature` and `key encipherment` if not specified. + * + * @return usages + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateRequestSpec v1alpha2CertificateRequestSpec = + (V1alpha2CertificateRequestSpec) o; + return Arrays.equals(this.csr, v1alpha2CertificateRequestSpec.csr) + && Objects.equals(this.duration, v1alpha2CertificateRequestSpec.duration) + && Objects.equals(this.isCA, v1alpha2CertificateRequestSpec.isCA) + && Objects.equals(this.issuerRef, v1alpha2CertificateRequestSpec.issuerRef) + && Objects.equals(this.usages, v1alpha2CertificateRequestSpec.usages); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(csr), duration, isCA, issuerRef, usages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateRequestSpec {\n"); + sb.append(" csr: ").append(toIndentedString(csr)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java new file mode 100644 index 0000000000..8e3258535a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java @@ -0,0 +1,886 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Desired state of the Certificate resource. */ +@ApiModel(description = "Desired state of the Certificate resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateSpec { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = null; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; + + @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) + private List emailSANs = null; + + public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; + + @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) + private List ipAddresses = null; + + public static final String SERIALIZED_NAME_IS_C_A = "isCA"; + + @SerializedName(SERIALIZED_NAME_IS_C_A) + private Boolean isCA; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1CertificateSpecIssuerRef issuerRef; + + /** + * KeyAlgorithm is the private key algorithm of the corresponding private key for this + * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 + * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + */ + @JsonAdapter(KeyAlgorithmEnum.Adapter.class) + public enum KeyAlgorithmEnum { + RSA("rsa"), + + ECDSA("ecdsa"); + + private String value; + + KeyAlgorithmEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyAlgorithmEnum fromValue(String value) { + for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyAlgorithmEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; + + @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) + private KeyAlgorithmEnum keyAlgorithm; + + /** + * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private + * key to be encoded in. If provided, allowed values are \"pkcs1\" and + * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not + * specified, then PKCS#1 will be used by default. + */ + @JsonAdapter(KeyEncodingEnum.Adapter.class) + public enum KeyEncodingEnum { + PKCS1("pkcs1"), + + PKCS8("pkcs8"); + + private String value; + + KeyEncodingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyEncodingEnum fromValue(String value) { + for (KeyEncodingEnum b : KeyEncodingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyEncodingEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyEncodingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyEncodingEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KEY_ENCODING = "keyEncoding"; + + @SerializedName(SERIALIZED_NAME_KEY_ENCODING) + private KeyEncodingEnum keyEncoding; + + public static final String SERIALIZED_NAME_KEY_SIZE = "keySize"; + + @SerializedName(SERIALIZED_NAME_KEY_SIZE) + private Integer keySize; + + public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; + + @SerializedName(SERIALIZED_NAME_KEYSTORES) + private V1beta1CertificateSpecKeystores keystores; + + public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; + + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + private List organization = null; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private V1alpha2CertificateSpecPrivateKey privateKey; + + public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; + + @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) + private String renewBefore; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + + @SerializedName(SERIALIZED_NAME_SUBJECT) + private V1alpha2CertificateSpecSubject subject; + + public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; + + @SerializedName(SERIALIZED_NAME_URI_S_A_NS) + private List uriSANs = null; + + /** + * KeyUsage specifies valid usage contexts for keys. See: + * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: + * \"signing\", \"digital signature\", \"content commitment\", + * \"key encipherment\", \"key agreement\", \"data encipherment\", + * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher + * only\", \"any\", \"server auth\", \"client auth\", + * \"code signing\", \"email protection\", \"s/mime\", \"ipsec + * end system\", \"ipsec tunnel\", \"ipsec user\", + * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", + * \"netscape sgc\" + */ + @JsonAdapter(UsagesEnum.Adapter.class) + public enum UsagesEnum { + SIGNING("signing"), + + DIGITAL_SIGNATURE("digital signature"), + + CONTENT_COMMITMENT("content commitment"), + + KEY_ENCIPHERMENT("key encipherment"), + + KEY_AGREEMENT("key agreement"), + + DATA_ENCIPHERMENT("data encipherment"), + + CERT_SIGN("cert sign"), + + CRL_SIGN("crl sign"), + + ENCIPHER_ONLY("encipher only"), + + DECIPHER_ONLY("decipher only"), + + ANY("any"), + + SERVER_AUTH("server auth"), + + CLIENT_AUTH("client auth"), + + CODE_SIGNING("code signing"), + + EMAIL_PROTECTION("email protection"), + + S_MIME("s/mime"), + + IPSEC_END_SYSTEM("ipsec end system"), + + IPSEC_TUNNEL("ipsec tunnel"), + + IPSEC_USER("ipsec user"), + + TIMESTAMPING("timestamping"), + + OCSP_SIGNING("ocsp signing"), + + MICROSOFT_SGC("microsoft sgc"), + + NETSCAPE_SGC("netscape sgc"); + + private String value; + + UsagesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsagesEnum fromValue(String value) { + for (UsagesEnum b : UsagesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsagesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsagesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_USAGES = "usages"; + + @SerializedName(SERIALIZED_NAME_USAGES) + private List usages = null; + + public V1alpha2CertificateSpec commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * CommonName is a common name to be used on the Certificate. The CommonName should have a length + * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS + * clients when any subject alt name is set. This is x509 behaviour: + * https://tools.ietf.org/html/rfc6125#section-6.4.4 + * + * @return commonName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public V1alpha2CertificateSpec dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1alpha2CertificateSpec addDnsNamesItem(String dnsNamesItem) { + if (this.dnsNames == null) { + this.dnsNames = new ArrayList(); + } + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + * + * @return dnsNames + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1alpha2CertificateSpec duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be + * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater + * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of + * the way through the certificate's duration. + * + * @return duration + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public V1alpha2CertificateSpec emailSANs(List emailSANs) { + + this.emailSANs = emailSANs; + return this; + } + + public V1alpha2CertificateSpec addEmailSANsItem(String emailSANsItem) { + if (this.emailSANs == null) { + this.emailSANs = new ArrayList(); + } + this.emailSANs.add(emailSANsItem); + return this; + } + + /** + * EmailSANs is a list of email subjectAltNames to be set on the Certificate. + * + * @return emailSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") + public List getEmailSANs() { + return emailSANs; + } + + public void setEmailSANs(List emailSANs) { + this.emailSANs = emailSANs; + } + + public V1alpha2CertificateSpec ipAddresses(List ipAddresses) { + + this.ipAddresses = ipAddresses; + return this; + } + + public V1alpha2CertificateSpec addIpAddressesItem(String ipAddressesItem) { + if (this.ipAddresses == null) { + this.ipAddresses = new ArrayList(); + } + this.ipAddresses.add(ipAddressesItem); + return this; + } + + /** + * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + * + * @return ipAddresses + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") + public List getIpAddresses() { + return ipAddresses; + } + + public void setIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + } + + public V1alpha2CertificateSpec isCA(Boolean isCA) { + + this.isCA = isCA; + return this; + } + + /** + * IsCA will mark this Certificate as valid for certificate signing. This will automatically add + * the `cert sign` usage to the list of `usages`. + * + * @return isCA + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") + public Boolean getIsCA() { + return isCA; + } + + public void setIsCA(Boolean isCA) { + this.isCA = isCA; + } + + public V1alpha2CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1alpha2CertificateSpec keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + + this.keyAlgorithm = keyAlgorithm; + return this; + } + + /** + * KeyAlgorithm is the private key algorithm of the corresponding private key for this + * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 + * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + * + * @return keyAlgorithm + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") + public KeyAlgorithmEnum getKeyAlgorithm() { + return keyAlgorithm; + } + + public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + } + + public V1alpha2CertificateSpec keyEncoding(KeyEncodingEnum keyEncoding) { + + this.keyEncoding = keyEncoding; + return this; + } + + /** + * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private + * key to be encoded in. If provided, allowed values are \"pkcs1\" and + * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not + * specified, then PKCS#1 will be used by default. + * + * @return keyEncoding + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not specified, then PKCS#1 will be used by default.") + public KeyEncodingEnum getKeyEncoding() { + return keyEncoding; + } + + public void setKeyEncoding(KeyEncodingEnum keyEncoding) { + this.keyEncoding = keyEncoding; + } + + public V1alpha2CertificateSpec keySize(Integer keySize) { + + this.keySize = keySize; + return this; + } + + /** + * KeySize is the key bit size of the corresponding private key for this certificate. If + * `keyAlgorithm` is set to `RSA`, valid values are `2048`, + * `4096` or `8192`, and will default to `2048` if not specified. If + * `keyAlgorithm` is set to `ECDSA`, valid values are `256`, + * `384` or `521`, and will default to `256` if not specified. No + * other values are allowed. minimum: 0 maximum: 8192 + * + * @return keySize + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeySize is the key bit size of the corresponding private key for this certificate. If `keyAlgorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `keyAlgorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") + public Integer getKeySize() { + return keySize; + } + + public void setKeySize(Integer keySize) { + this.keySize = keySize; + } + + public V1alpha2CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { + + this.keystores = keystores; + return this; + } + + /** + * Get keystores + * + * @return keystores + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecKeystores getKeystores() { + return keystores; + } + + public void setKeystores(V1beta1CertificateSpecKeystores keystores) { + this.keystores = keystores; + } + + public V1alpha2CertificateSpec organization(List organization) { + + this.organization = organization; + return this; + } + + public V1alpha2CertificateSpec addOrganizationItem(String organizationItem) { + if (this.organization == null) { + this.organization = new ArrayList(); + } + this.organization.add(organizationItem); + return this; + } + + /** + * Organization is a list of organizations to be used on the Certificate. + * + * @return organization + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Organization is a list of organizations to be used on the Certificate.") + public List getOrganization() { + return organization; + } + + public void setOrganization(List organization) { + this.organization = organization; + } + + public V1alpha2CertificateSpec privateKey(V1alpha2CertificateSpecPrivateKey privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * + * @return privateKey + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateSpecPrivateKey getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(V1alpha2CertificateSpecPrivateKey privateKey) { + this.privateKey = privateKey; + } + + public V1alpha2CertificateSpec renewBefore(String renewBefore) { + + this.renewBefore = renewBefore; + return this; + } + + /** + * The amount of time before the currently issued certificate's `notAfter` time that + * cert-manager will begin to attempt to renew the certificate. If this value is greater than the + * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed + * 2/3rds of the way through the certificate's duration. + * + * @return renewBefore + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getRenewBefore() { + return renewBefore; + } + + public void setRenewBefore(String renewBefore) { + this.renewBefore = renewBefore; + } + + public V1alpha2CertificateSpec secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * SecretName is the name of the secret resource that will be automatically created and managed by + * this Certificate resource. It will be populated with a private key and certificate, signed by + * the denoted issuer. + * + * @return secretName + */ + @ApiModelProperty( + required = true, + value = + "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + public V1alpha2CertificateSpec subject(V1alpha2CertificateSpecSubject subject) { + + this.subject = subject; + return this; + } + + /** + * Get subject + * + * @return subject + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateSpecSubject getSubject() { + return subject; + } + + public void setSubject(V1alpha2CertificateSpecSubject subject) { + this.subject = subject; + } + + public V1alpha2CertificateSpec uriSANs(List uriSANs) { + + this.uriSANs = uriSANs; + return this; + } + + public V1alpha2CertificateSpec addUriSANsItem(String uriSANsItem) { + if (this.uriSANs == null) { + this.uriSANs = new ArrayList(); + } + this.uriSANs.add(uriSANsItem); + return this; + } + + /** + * URISANs is a list of URI subjectAltNames to be set on the Certificate. + * + * @return uriSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") + public List getUriSANs() { + return uriSANs; + } + + public void setUriSANs(List uriSANs) { + this.uriSANs = uriSANs; + } + + public V1alpha2CertificateSpec usages(List usages) { + + this.usages = usages; + return this; + } + + public V1alpha2CertificateSpec addUsagesItem(UsagesEnum usagesItem) { + if (this.usages == null) { + this.usages = new ArrayList(); + } + this.usages.add(usagesItem); + return this; + } + + /** + * Usages is the set of x509 usages that are requested for the certificate. Defaults to + * `digital signature` and `key encipherment` if not specified. + * + * @return usages + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateSpec v1alpha2CertificateSpec = (V1alpha2CertificateSpec) o; + return Objects.equals(this.commonName, v1alpha2CertificateSpec.commonName) + && Objects.equals(this.dnsNames, v1alpha2CertificateSpec.dnsNames) + && Objects.equals(this.duration, v1alpha2CertificateSpec.duration) + && Objects.equals(this.emailSANs, v1alpha2CertificateSpec.emailSANs) + && Objects.equals(this.ipAddresses, v1alpha2CertificateSpec.ipAddresses) + && Objects.equals(this.isCA, v1alpha2CertificateSpec.isCA) + && Objects.equals(this.issuerRef, v1alpha2CertificateSpec.issuerRef) + && Objects.equals(this.keyAlgorithm, v1alpha2CertificateSpec.keyAlgorithm) + && Objects.equals(this.keyEncoding, v1alpha2CertificateSpec.keyEncoding) + && Objects.equals(this.keySize, v1alpha2CertificateSpec.keySize) + && Objects.equals(this.keystores, v1alpha2CertificateSpec.keystores) + && Objects.equals(this.organization, v1alpha2CertificateSpec.organization) + && Objects.equals(this.privateKey, v1alpha2CertificateSpec.privateKey) + && Objects.equals(this.renewBefore, v1alpha2CertificateSpec.renewBefore) + && Objects.equals(this.secretName, v1alpha2CertificateSpec.secretName) + && Objects.equals(this.subject, v1alpha2CertificateSpec.subject) + && Objects.equals(this.uriSANs, v1alpha2CertificateSpec.uriSANs) + && Objects.equals(this.usages, v1alpha2CertificateSpec.usages); + } + + @Override + public int hashCode() { + return Objects.hash( + commonName, + dnsNames, + duration, + emailSANs, + ipAddresses, + isCA, + issuerRef, + keyAlgorithm, + keyEncoding, + keySize, + keystores, + organization, + privateKey, + renewBefore, + secretName, + subject, + uriSANs, + usages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateSpec {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); + sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); + sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); + sb.append(" keyEncoding: ").append(toIndentedString(keyEncoding)).append("\n"); + sb.append(" keySize: ").append(toIndentedString(keySize)).append("\n"); + sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); + sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java new file mode 100644 index 0000000000..67650f07ef --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java @@ -0,0 +1,95 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Options to control private keys used for the Certificate. */ +@ApiModel(description = "Options to control private keys used for the Certificate.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateSpecPrivateKey { + public static final String SERIALIZED_NAME_ROTATION_POLICY = "rotationPolicy"; + + @SerializedName(SERIALIZED_NAME_ROTATION_POLICY) + private String rotationPolicy; + + public V1alpha2CertificateSpecPrivateKey rotationPolicy(String rotationPolicy) { + + this.rotationPolicy = rotationPolicy; + return this; + } + + /** + * RotationPolicy controls how private keys should be regenerated when a re-issuance is being + * processed. If set to Never, a private key will only be generated if one does not already exist + * in the target `spec.secretName`. If one does exists but it does not have the correct + * algorithm or size, a warning will be raised to await user intervention. If set to Always, a + * private key matching the specified requirements will be generated whenever a re-issuance + * occurs. Default is 'Never' for backward compatibility. + * + * @return rotationPolicy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility.") + public String getRotationPolicy() { + return rotationPolicy; + } + + public void setRotationPolicy(String rotationPolicy) { + this.rotationPolicy = rotationPolicy; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateSpecPrivateKey v1alpha2CertificateSpecPrivateKey = + (V1alpha2CertificateSpecPrivateKey) o; + return Objects.equals(this.rotationPolicy, v1alpha2CertificateSpecPrivateKey.rotationPolicy); + } + + @Override + public int hashCode() { + return Objects.hash(rotationPolicy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateSpecPrivateKey {\n"); + sb.append(" rotationPolicy: ").append(toIndentedString(rotationPolicy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java new file mode 100644 index 0000000000..2c33b100d4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java @@ -0,0 +1,317 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). */ +@ApiModel( + description = "Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2CertificateSpecSubject { + public static final String SERIALIZED_NAME_COUNTRIES = "countries"; + + @SerializedName(SERIALIZED_NAME_COUNTRIES) + private List countries = null; + + public static final String SERIALIZED_NAME_LOCALITIES = "localities"; + + @SerializedName(SERIALIZED_NAME_LOCALITIES) + private List localities = null; + + public static final String SERIALIZED_NAME_ORGANIZATIONAL_UNITS = "organizationalUnits"; + + @SerializedName(SERIALIZED_NAME_ORGANIZATIONAL_UNITS) + private List organizationalUnits = null; + + public static final String SERIALIZED_NAME_POSTAL_CODES = "postalCodes"; + + @SerializedName(SERIALIZED_NAME_POSTAL_CODES) + private List postalCodes = null; + + public static final String SERIALIZED_NAME_PROVINCES = "provinces"; + + @SerializedName(SERIALIZED_NAME_PROVINCES) + private List provinces = null; + + public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serialNumber"; + + @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) + private String serialNumber; + + public static final String SERIALIZED_NAME_STREET_ADDRESSES = "streetAddresses"; + + @SerializedName(SERIALIZED_NAME_STREET_ADDRESSES) + private List streetAddresses = null; + + public V1alpha2CertificateSpecSubject countries(List countries) { + + this.countries = countries; + return this; + } + + public V1alpha2CertificateSpecSubject addCountriesItem(String countriesItem) { + if (this.countries == null) { + this.countries = new ArrayList(); + } + this.countries.add(countriesItem); + return this; + } + + /** + * Countries to be used on the Certificate. + * + * @return countries + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Countries to be used on the Certificate.") + public List getCountries() { + return countries; + } + + public void setCountries(List countries) { + this.countries = countries; + } + + public V1alpha2CertificateSpecSubject localities(List localities) { + + this.localities = localities; + return this; + } + + public V1alpha2CertificateSpecSubject addLocalitiesItem(String localitiesItem) { + if (this.localities == null) { + this.localities = new ArrayList(); + } + this.localities.add(localitiesItem); + return this; + } + + /** + * Cities to be used on the Certificate. + * + * @return localities + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Cities to be used on the Certificate.") + public List getLocalities() { + return localities; + } + + public void setLocalities(List localities) { + this.localities = localities; + } + + public V1alpha2CertificateSpecSubject organizationalUnits(List organizationalUnits) { + + this.organizationalUnits = organizationalUnits; + return this; + } + + public V1alpha2CertificateSpecSubject addOrganizationalUnitsItem(String organizationalUnitsItem) { + if (this.organizationalUnits == null) { + this.organizationalUnits = new ArrayList(); + } + this.organizationalUnits.add(organizationalUnitsItem); + return this; + } + + /** + * Organizational Units to be used on the Certificate. + * + * @return organizationalUnits + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Organizational Units to be used on the Certificate.") + public List getOrganizationalUnits() { + return organizationalUnits; + } + + public void setOrganizationalUnits(List organizationalUnits) { + this.organizationalUnits = organizationalUnits; + } + + public V1alpha2CertificateSpecSubject postalCodes(List postalCodes) { + + this.postalCodes = postalCodes; + return this; + } + + public V1alpha2CertificateSpecSubject addPostalCodesItem(String postalCodesItem) { + if (this.postalCodes == null) { + this.postalCodes = new ArrayList(); + } + this.postalCodes.add(postalCodesItem); + return this; + } + + /** + * Postal codes to be used on the Certificate. + * + * @return postalCodes + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Postal codes to be used on the Certificate.") + public List getPostalCodes() { + return postalCodes; + } + + public void setPostalCodes(List postalCodes) { + this.postalCodes = postalCodes; + } + + public V1alpha2CertificateSpecSubject provinces(List provinces) { + + this.provinces = provinces; + return this; + } + + public V1alpha2CertificateSpecSubject addProvincesItem(String provincesItem) { + if (this.provinces == null) { + this.provinces = new ArrayList(); + } + this.provinces.add(provincesItem); + return this; + } + + /** + * State/Provinces to be used on the Certificate. + * + * @return provinces + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "State/Provinces to be used on the Certificate.") + public List getProvinces() { + return provinces; + } + + public void setProvinces(List provinces) { + this.provinces = provinces; + } + + public V1alpha2CertificateSpecSubject serialNumber(String serialNumber) { + + this.serialNumber = serialNumber; + return this; + } + + /** + * Serial number to be used on the Certificate. + * + * @return serialNumber + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Serial number to be used on the Certificate.") + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public V1alpha2CertificateSpecSubject streetAddresses(List streetAddresses) { + + this.streetAddresses = streetAddresses; + return this; + } + + public V1alpha2CertificateSpecSubject addStreetAddressesItem(String streetAddressesItem) { + if (this.streetAddresses == null) { + this.streetAddresses = new ArrayList(); + } + this.streetAddresses.add(streetAddressesItem); + return this; + } + + /** + * Street addresses to be used on the Certificate. + * + * @return streetAddresses + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Street addresses to be used on the Certificate.") + public List getStreetAddresses() { + return streetAddresses; + } + + public void setStreetAddresses(List streetAddresses) { + this.streetAddresses = streetAddresses; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2CertificateSpecSubject v1alpha2CertificateSpecSubject = + (V1alpha2CertificateSpecSubject) o; + return Objects.equals(this.countries, v1alpha2CertificateSpecSubject.countries) + && Objects.equals(this.localities, v1alpha2CertificateSpecSubject.localities) + && Objects.equals( + this.organizationalUnits, v1alpha2CertificateSpecSubject.organizationalUnits) + && Objects.equals(this.postalCodes, v1alpha2CertificateSpecSubject.postalCodes) + && Objects.equals(this.provinces, v1alpha2CertificateSpecSubject.provinces) + && Objects.equals(this.serialNumber, v1alpha2CertificateSpecSubject.serialNumber) + && Objects.equals(this.streetAddresses, v1alpha2CertificateSpecSubject.streetAddresses); + } + + @Override + public int hashCode() { + return Objects.hash( + countries, + localities, + organizationalUnits, + postalCodes, + provinces, + serialNumber, + streetAddresses); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2CertificateSpecSubject {\n"); + sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); + sb.append(" localities: ").append(toIndentedString(localities)).append("\n"); + sb.append(" organizationalUnits: ") + .append(toIndentedString(organizationalUnits)) + .append("\n"); + sb.append(" postalCodes: ").append(toIndentedString(postalCodes)).append("\n"); + sb.append(" provinces: ").append(toIndentedString(provinces)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" streetAddresses: ").append(toIndentedString(streetAddresses)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java new file mode 100644 index 0000000000..ba7c558157 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java @@ -0,0 +1,209 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Challenge is a type to represent a Challenge request with an ACME server */ +@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2Challenge implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3ChallengeSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha3ChallengeStatus status; + + public V1alpha2Challenge apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2Challenge kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2Challenge metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2Challenge spec(V1alpha3ChallengeSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ChallengeSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3ChallengeSpec spec) { + this.spec = spec; + } + + public V1alpha2Challenge status(V1alpha3ChallengeStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ChallengeStatus getStatus() { + return status; + } + + public void setStatus(V1alpha3ChallengeStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2Challenge v1alpha2Challenge = (V1alpha2Challenge) o; + return Objects.equals(this.apiVersion, v1alpha2Challenge.apiVersion) + && Objects.equals(this.kind, v1alpha2Challenge.kind) + && Objects.equals(this.metadata, v1alpha2Challenge.metadata) + && Objects.equals(this.spec, v1alpha2Challenge.spec) + && Objects.equals(this.status, v1alpha2Challenge.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2Challenge {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java new file mode 100644 index 0000000000..e1d4cf8c3f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ChallengeList is a list of Challenge */ +@ApiModel(description = "ChallengeList is a list of Challenge") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2ChallengeList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2ChallengeList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2ChallengeList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2ChallengeList addItemsItem(V1alpha2Challenge itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of challenges. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2ChallengeList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2ChallengeList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2ChallengeList v1alpha2ChallengeList = (V1alpha2ChallengeList) o; + return Objects.equals(this.apiVersion, v1alpha2ChallengeList.apiVersion) + && Objects.equals(this.items, v1alpha2ChallengeList.items) + && Objects.equals(this.kind, v1alpha2ChallengeList.kind) + && Objects.equals(this.metadata, v1alpha2ChallengeList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2ChallengeList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java new file mode 100644 index 0000000000..01c61268ca --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java @@ -0,0 +1,217 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and + * therefore can be referenced by resources that exist in *any* namespace, not just the same + * namespace as the referent. + */ +@ApiModel( + description = + "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3ClusterIssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha3ClusterIssuerStatus status; + + public V1alpha2ClusterIssuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2ClusterIssuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2ClusterIssuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2ClusterIssuer spec(V1alpha3ClusterIssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ClusterIssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3ClusterIssuerSpec spec) { + this.spec = spec; + } + + public V1alpha2ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ClusterIssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha3ClusterIssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2ClusterIssuer v1alpha2ClusterIssuer = (V1alpha2ClusterIssuer) o; + return Objects.equals(this.apiVersion, v1alpha2ClusterIssuer.apiVersion) + && Objects.equals(this.kind, v1alpha2ClusterIssuer.kind) + && Objects.equals(this.metadata, v1alpha2ClusterIssuer.metadata) + && Objects.equals(this.spec, v1alpha2ClusterIssuer.spec) + && Objects.equals(this.status, v1alpha2ClusterIssuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2ClusterIssuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java new file mode 100644 index 0000000000..1d801fecb4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ClusterIssuerList is a list of ClusterIssuer */ +@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2ClusterIssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2ClusterIssuerList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2ClusterIssuerList addItemsItem(V1alpha2ClusterIssuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of clusterissuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2ClusterIssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2ClusterIssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2ClusterIssuerList v1alpha2ClusterIssuerList = (V1alpha2ClusterIssuerList) o; + return Objects.equals(this.apiVersion, v1alpha2ClusterIssuerList.apiVersion) + && Objects.equals(this.items, v1alpha2ClusterIssuerList.items) + && Objects.equals(this.kind, v1alpha2ClusterIssuerList.kind) + && Objects.equals(this.metadata, v1alpha2ClusterIssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2ClusterIssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java new file mode 100644 index 0000000000..bc7673971d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * An Issuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is scoped to a single namespace and can therefore only be + * referenced by resources within the same namespace. + */ +@ApiModel( + description = + "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2Issuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2IssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha2IssuerStatus status; + + public V1alpha2Issuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2Issuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2Issuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2Issuer spec(V1alpha2IssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2IssuerSpec spec) { + this.spec = spec; + } + + public V1alpha2Issuer status(V1alpha2IssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha2IssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2Issuer v1alpha2Issuer = (V1alpha2Issuer) o; + return Objects.equals(this.apiVersion, v1alpha2Issuer.apiVersion) + && Objects.equals(this.kind, v1alpha2Issuer.kind) + && Objects.equals(this.metadata, v1alpha2Issuer.metadata) + && Objects.equals(this.spec, v1alpha2Issuer.spec) + && Objects.equals(this.status, v1alpha2Issuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2Issuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java new file mode 100644 index 0000000000..15472546e4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** IssuerList is a list of Issuer */ +@ApiModel(description = "IssuerList is a list of Issuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2IssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2IssuerList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2IssuerList addItemsItem(V1alpha2Issuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of issuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2IssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2IssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerList v1alpha2IssuerList = (V1alpha2IssuerList) o; + return Objects.equals(this.apiVersion, v1alpha2IssuerList.apiVersion) + && Objects.equals(this.items, v1alpha2IssuerList.items) + && Objects.equals(this.kind, v1alpha2IssuerList.kind) + && Objects.equals(this.metadata, v1alpha2IssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java new file mode 100644 index 0000000000..a841c044a1 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java @@ -0,0 +1,199 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Desired state of the Issuer resource. */ +@ApiModel(description = "Desired state of the Issuer resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpec { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1alpha2IssuerSpecAcme acme; + + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1alpha2IssuerSpecCa ca; + + public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; + + @SerializedName(SERIALIZED_NAME_SELF_SIGNED) + private V1alpha2IssuerSpecSelfSigned selfSigned; + + public static final String SERIALIZED_NAME_VAULT = "vault"; + + @SerializedName(SERIALIZED_NAME_VAULT) + private V1alpha2IssuerSpecVault vault; + + public static final String SERIALIZED_NAME_VENAFI = "venafi"; + + @SerializedName(SERIALIZED_NAME_VENAFI) + private V1alpha2IssuerSpecVenafi venafi; + + public V1alpha2IssuerSpec acme(V1alpha2IssuerSpecAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcme getAcme() { + return acme; + } + + public void setAcme(V1alpha2IssuerSpecAcme acme) { + this.acme = acme; + } + + public V1alpha2IssuerSpec ca(V1alpha2IssuerSpecCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecCa getCa() { + return ca; + } + + public void setCa(V1alpha2IssuerSpecCa ca) { + this.ca = ca; + } + + public V1alpha2IssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + + this.selfSigned = selfSigned; + return this; + } + + /** + * Get selfSigned + * + * @return selfSigned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecSelfSigned getSelfSigned() { + return selfSigned; + } + + public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + this.selfSigned = selfSigned; + } + + public V1alpha2IssuerSpec vault(V1alpha2IssuerSpecVault vault) { + + this.vault = vault; + return this; + } + + /** + * Get vault + * + * @return vault + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVault getVault() { + return vault; + } + + public void setVault(V1alpha2IssuerSpecVault vault) { + this.vault = vault; + } + + public V1alpha2IssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { + + this.venafi = venafi; + return this; + } + + /** + * Get venafi + * + * @return venafi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafi getVenafi() { + return venafi; + } + + public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { + this.venafi = venafi; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpec v1alpha2IssuerSpec = (V1alpha2IssuerSpec) o; + return Objects.equals(this.acme, v1alpha2IssuerSpec.acme) + && Objects.equals(this.ca, v1alpha2IssuerSpec.ca) + && Objects.equals(this.selfSigned, v1alpha2IssuerSpec.selfSigned) + && Objects.equals(this.vault, v1alpha2IssuerSpec.vault) + && Objects.equals(this.venafi, v1alpha2IssuerSpec.venafi); + } + + @Override + public int hashCode() { + return Objects.hash(acme, ca, selfSigned, vault, venafi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpec {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); + sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); + sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java new file mode 100644 index 0000000000..507f3125b3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java @@ -0,0 +1,271 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 + * certificates. + */ +@ApiModel( + description = + "ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 certificates.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcme { + public static final String SERIALIZED_NAME_EMAIL = "email"; + + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING = "externalAccountBinding"; + + @SerializedName(SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING) + private V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding; + + public static final String SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF = "privateKeySecretRef"; + + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF) + private V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef; + + public static final String SERIALIZED_NAME_SERVER = "server"; + + @SerializedName(SERIALIZED_NAME_SERVER) + private String server; + + public static final String SERIALIZED_NAME_SKIP_T_L_S_VERIFY = "skipTLSVerify"; + + @SerializedName(SERIALIZED_NAME_SKIP_T_L_S_VERIFY) + private Boolean skipTLSVerify; + + public static final String SERIALIZED_NAME_SOLVERS = "solvers"; + + @SerializedName(SERIALIZED_NAME_SOLVERS) + private List solvers = null; + + public V1alpha2IssuerSpecAcme email(String email) { + + this.email = email; + return this; + } + + /** + * Email is the email address to be associated with the ACME account. This field is optional, but + * it is strongly recommended to be set. It will be used to contact you in case of issues with + * your account or certificates, including expiry notification emails. This field may be updated + * after the account is initially registered. + * + * @return email + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Email is the email address to be associated with the ACME account. This field is optional, but it is strongly recommended to be set. It will be used to contact you in case of issues with your account or certificates, including expiry notification emails. This field may be updated after the account is initially registered.") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public V1alpha2IssuerSpecAcme externalAccountBinding( + V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { + + this.externalAccountBinding = externalAccountBinding; + return this; + } + + /** + * Get externalAccountBinding + * + * @return externalAccountBinding + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeExternalAccountBinding getExternalAccountBinding() { + return externalAccountBinding; + } + + public void setExternalAccountBinding( + V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { + this.externalAccountBinding = externalAccountBinding; + } + + public V1alpha2IssuerSpecAcme privateKeySecretRef( + V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { + + this.privateKeySecretRef = privateKeySecretRef; + return this; + } + + /** + * Get privateKeySecretRef + * + * @return privateKeySecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmePrivateKeySecretRef getPrivateKeySecretRef() { + return privateKeySecretRef; + } + + public void setPrivateKeySecretRef( + V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { + this.privateKeySecretRef = privateKeySecretRef; + } + + public V1alpha2IssuerSpecAcme server(String server) { + + this.server = server; + return this; + } + + /** + * Server is the URL used to access the ACME server's 'directory' endpoint. For + * example, for Let's Encrypt's staging endpoint, you would use: + * \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints + * (i.e. RFC 8555) are supported. + * + * @return server + */ + @ApiModelProperty( + required = true, + value = + "Server is the URL used to access the ACME server's 'directory' endpoint. For example, for Let's Encrypt's staging endpoint, you would use: \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints (i.e. RFC 8555) are supported.") + public String getServer() { + return server; + } + + public void setServer(String server) { + this.server = server; + } + + public V1alpha2IssuerSpecAcme skipTLSVerify(Boolean skipTLSVerify) { + + this.skipTLSVerify = skipTLSVerify; + return this; + } + + /** + * Enables or disables validation of the ACME server TLS certificate. If true, requests to the + * ACME server will not have their TLS certificate validated (i.e. insecure connections will be + * allowed). Only enable this option in development environments. The cert-manager system + * installed roots will be used to verify connections to the ACME server if this is false. + * Defaults to false. + * + * @return skipTLSVerify + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enables or disables validation of the ACME server TLS certificate. If true, requests to the ACME server will not have their TLS certificate validated (i.e. insecure connections will be allowed). Only enable this option in development environments. The cert-manager system installed roots will be used to verify connections to the ACME server if this is false. Defaults to false.") + public Boolean getSkipTLSVerify() { + return skipTLSVerify; + } + + public void setSkipTLSVerify(Boolean skipTLSVerify) { + this.skipTLSVerify = skipTLSVerify; + } + + public V1alpha2IssuerSpecAcme solvers(List solvers) { + + this.solvers = solvers; + return this; + } + + public V1alpha2IssuerSpecAcme addSolversItem(V1alpha2IssuerSpecAcmeSolvers solversItem) { + if (this.solvers == null) { + this.solvers = new ArrayList(); + } + this.solvers.add(solversItem); + return this; + } + + /** + * Solvers is a list of challenge solvers that will be used to solve ACME challenges for the + * matching domains. Solver configurations must be provided in order to obtain certificates from + * an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/ + * + * @return solvers + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Solvers is a list of challenge solvers that will be used to solve ACME challenges for the matching domains. Solver configurations must be provided in order to obtain certificates from an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/") + public List getSolvers() { + return solvers; + } + + public void setSolvers(List solvers) { + this.solvers = solvers; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcme v1alpha2IssuerSpecAcme = (V1alpha2IssuerSpecAcme) o; + return Objects.equals(this.email, v1alpha2IssuerSpecAcme.email) + && Objects.equals( + this.externalAccountBinding, v1alpha2IssuerSpecAcme.externalAccountBinding) + && Objects.equals(this.privateKeySecretRef, v1alpha2IssuerSpecAcme.privateKeySecretRef) + && Objects.equals(this.server, v1alpha2IssuerSpecAcme.server) + && Objects.equals(this.skipTLSVerify, v1alpha2IssuerSpecAcme.skipTLSVerify) + && Objects.equals(this.solvers, v1alpha2IssuerSpecAcme.solvers); + } + + @Override + public int hashCode() { + return Objects.hash( + email, externalAccountBinding, privateKeySecretRef, server, skipTLSVerify, solvers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcme {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" externalAccountBinding: ") + .append(toIndentedString(externalAccountBinding)) + .append("\n"); + sb.append(" privateKeySecretRef: ") + .append(toIndentedString(privateKeySecretRef)) + .append("\n"); + sb.append(" server: ").append(toIndentedString(server)).append("\n"); + sb.append(" skipTLSVerify: ").append(toIndentedString(skipTLSVerify)).append("\n"); + sb.append(" solvers: ").append(toIndentedString(solvers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java new file mode 100644 index 0000000000..52f2b05156 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java @@ -0,0 +1,412 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** + * Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge + * flow. + */ +@ApiModel( + description = + "Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge flow.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01 { + public static final String SERIALIZED_NAME_ACMEDNS = "acmedns"; + + @SerializedName(SERIALIZED_NAME_ACMEDNS) + private V1alpha2IssuerSpecAcmeDns01Acmedns acmedns; + + public static final String SERIALIZED_NAME_AKAMAI = "akamai"; + + @SerializedName(SERIALIZED_NAME_AKAMAI) + private V1alpha2IssuerSpecAcmeDns01Akamai akamai; + + public static final String SERIALIZED_NAME_AZUREDNS = "azuredns"; + + @SerializedName(SERIALIZED_NAME_AZUREDNS) + private V1alpha2IssuerSpecAcmeDns01Azuredns azuredns; + + public static final String SERIALIZED_NAME_CLOUDDNS = "clouddns"; + + @SerializedName(SERIALIZED_NAME_CLOUDDNS) + private V1alpha2IssuerSpecAcmeDns01Clouddns clouddns; + + public static final String SERIALIZED_NAME_CLOUDFLARE = "cloudflare"; + + @SerializedName(SERIALIZED_NAME_CLOUDFLARE) + private V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare; + + /** + * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS + * zones. + */ + @JsonAdapter(CnameStrategyEnum.Adapter.class) + public enum CnameStrategyEnum { + NONE("None"), + + FOLLOW("Follow"); + + private String value; + + CnameStrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CnameStrategyEnum fromValue(String value) { + for (CnameStrategyEnum b : CnameStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CnameStrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CnameStrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CnameStrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CNAME_STRATEGY = "cnameStrategy"; + + @SerializedName(SERIALIZED_NAME_CNAME_STRATEGY) + private CnameStrategyEnum cnameStrategy; + + public static final String SERIALIZED_NAME_DIGITALOCEAN = "digitalocean"; + + @SerializedName(SERIALIZED_NAME_DIGITALOCEAN) + private V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean; + + public static final String SERIALIZED_NAME_RFC2136 = "rfc2136"; + + @SerializedName(SERIALIZED_NAME_RFC2136) + private V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136; + + public static final String SERIALIZED_NAME_ROUTE53 = "route53"; + + @SerializedName(SERIALIZED_NAME_ROUTE53) + private V1alpha2IssuerSpecAcmeDns01Route53 route53; + + public static final String SERIALIZED_NAME_WEBHOOK = "webhook"; + + @SerializedName(SERIALIZED_NAME_WEBHOOK) + private V1alpha2IssuerSpecAcmeDns01Webhook webhook; + + public V1alpha2IssuerSpecAcmeDns01 acmedns(V1alpha2IssuerSpecAcmeDns01Acmedns acmedns) { + + this.acmedns = acmedns; + return this; + } + + /** + * Get acmedns + * + * @return acmedns + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Acmedns getAcmedns() { + return acmedns; + } + + public void setAcmedns(V1alpha2IssuerSpecAcmeDns01Acmedns acmedns) { + this.acmedns = acmedns; + } + + public V1alpha2IssuerSpecAcmeDns01 akamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { + + this.akamai = akamai; + return this; + } + + /** + * Get akamai + * + * @return akamai + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Akamai getAkamai() { + return akamai; + } + + public void setAkamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { + this.akamai = akamai; + } + + public V1alpha2IssuerSpecAcmeDns01 azuredns(V1alpha2IssuerSpecAcmeDns01Azuredns azuredns) { + + this.azuredns = azuredns; + return this; + } + + /** + * Get azuredns + * + * @return azuredns + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Azuredns getAzuredns() { + return azuredns; + } + + public void setAzuredns(V1alpha2IssuerSpecAcmeDns01Azuredns azuredns) { + this.azuredns = azuredns; + } + + public V1alpha2IssuerSpecAcmeDns01 clouddns(V1alpha2IssuerSpecAcmeDns01Clouddns clouddns) { + + this.clouddns = clouddns; + return this; + } + + /** + * Get clouddns + * + * @return clouddns + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Clouddns getClouddns() { + return clouddns; + } + + public void setClouddns(V1alpha2IssuerSpecAcmeDns01Clouddns clouddns) { + this.clouddns = clouddns; + } + + public V1alpha2IssuerSpecAcmeDns01 cloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { + + this.cloudflare = cloudflare; + return this; + } + + /** + * Get cloudflare + * + * @return cloudflare + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Cloudflare getCloudflare() { + return cloudflare; + } + + public void setCloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { + this.cloudflare = cloudflare; + } + + public V1alpha2IssuerSpecAcmeDns01 cnameStrategy(CnameStrategyEnum cnameStrategy) { + + this.cnameStrategy = cnameStrategy; + return this; + } + + /** + * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS + * zones. + * + * @return cnameStrategy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS zones.") + public CnameStrategyEnum getCnameStrategy() { + return cnameStrategy; + } + + public void setCnameStrategy(CnameStrategyEnum cnameStrategy) { + this.cnameStrategy = cnameStrategy; + } + + public V1alpha2IssuerSpecAcmeDns01 digitalocean( + V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { + + this.digitalocean = digitalocean; + return this; + } + + /** + * Get digitalocean + * + * @return digitalocean + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Digitalocean getDigitalocean() { + return digitalocean; + } + + public void setDigitalocean(V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { + this.digitalocean = digitalocean; + } + + public V1alpha2IssuerSpecAcmeDns01 rfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { + + this.rfc2136 = rfc2136; + return this; + } + + /** + * Get rfc2136 + * + * @return rfc2136 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Rfc2136 getRfc2136() { + return rfc2136; + } + + public void setRfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { + this.rfc2136 = rfc2136; + } + + public V1alpha2IssuerSpecAcmeDns01 route53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { + + this.route53 = route53; + return this; + } + + /** + * Get route53 + * + * @return route53 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Route53 getRoute53() { + return route53; + } + + public void setRoute53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { + this.route53 = route53; + } + + public V1alpha2IssuerSpecAcmeDns01 webhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { + + this.webhook = webhook; + return this; + } + + /** + * Get webhook + * + * @return webhook + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Webhook getWebhook() { + return webhook; + } + + public void setWebhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { + this.webhook = webhook; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01 v1alpha2IssuerSpecAcmeDns01 = (V1alpha2IssuerSpecAcmeDns01) o; + return Objects.equals(this.acmedns, v1alpha2IssuerSpecAcmeDns01.acmedns) + && Objects.equals(this.akamai, v1alpha2IssuerSpecAcmeDns01.akamai) + && Objects.equals(this.azuredns, v1alpha2IssuerSpecAcmeDns01.azuredns) + && Objects.equals(this.clouddns, v1alpha2IssuerSpecAcmeDns01.clouddns) + && Objects.equals(this.cloudflare, v1alpha2IssuerSpecAcmeDns01.cloudflare) + && Objects.equals(this.cnameStrategy, v1alpha2IssuerSpecAcmeDns01.cnameStrategy) + && Objects.equals(this.digitalocean, v1alpha2IssuerSpecAcmeDns01.digitalocean) + && Objects.equals(this.rfc2136, v1alpha2IssuerSpecAcmeDns01.rfc2136) + && Objects.equals(this.route53, v1alpha2IssuerSpecAcmeDns01.route53) + && Objects.equals(this.webhook, v1alpha2IssuerSpecAcmeDns01.webhook); + } + + @Override + public int hashCode() { + return Objects.hash( + acmedns, + akamai, + azuredns, + clouddns, + cloudflare, + cnameStrategy, + digitalocean, + rfc2136, + route53, + webhook); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01 {\n"); + sb.append(" acmedns: ").append(toIndentedString(acmedns)).append("\n"); + sb.append(" akamai: ").append(toIndentedString(akamai)).append("\n"); + sb.append(" azuredns: ").append(toIndentedString(azuredns)).append("\n"); + sb.append(" clouddns: ").append(toIndentedString(clouddns)).append("\n"); + sb.append(" cloudflare: ").append(toIndentedString(cloudflare)).append("\n"); + sb.append(" cnameStrategy: ").append(toIndentedString(cnameStrategy)).append("\n"); + sb.append(" digitalocean: ").append(toIndentedString(digitalocean)).append("\n"); + sb.append(" rfc2136: ").append(toIndentedString(rfc2136)).append("\n"); + sb.append(" route53: ").append(toIndentedString(route53)).append("\n"); + sb.append(" webhook: ").append(toIndentedString(webhook)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java new file mode 100644 index 0000000000..4eef9e4cf4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java @@ -0,0 +1,122 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage DNS01 challenge + * records. + */ +@ApiModel( + description = + "Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Acmedns { + public static final String SERIALIZED_NAME_ACCOUNT_SECRET_REF = "accountSecretRef"; + + @SerializedName(SERIALIZED_NAME_ACCOUNT_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef; + + public static final String SERIALIZED_NAME_HOST = "host"; + + @SerializedName(SERIALIZED_NAME_HOST) + private String host; + + public V1alpha2IssuerSpecAcmeDns01Acmedns accountSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef) { + + this.accountSecretRef = accountSecretRef; + return this; + } + + /** + * Get accountSecretRef + * + * @return accountSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getAccountSecretRef() { + return accountSecretRef; + } + + public void setAccountSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef) { + this.accountSecretRef = accountSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Acmedns host(String host) { + + this.host = host; + return this; + } + + /** + * Get host + * + * @return host + */ + @ApiModelProperty(required = true, value = "") + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Acmedns v1alpha2IssuerSpecAcmeDns01Acmedns = + (V1alpha2IssuerSpecAcmeDns01Acmedns) o; + return Objects.equals( + this.accountSecretRef, v1alpha2IssuerSpecAcmeDns01Acmedns.accountSecretRef) + && Objects.equals(this.host, v1alpha2IssuerSpecAcmeDns01Acmedns.host); + } + + @Override + public int hashCode() { + return Objects.hash(accountSecretRef, host); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Acmedns {\n"); + sb.append(" accountSecretRef: ").append(toIndentedString(accountSecretRef)).append("\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java new file mode 100644 index 0000000000..40f83f8ccb --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A reference to a specific 'key' within a Secret resource. In some instances, + * `key` is a required field. + */ +@ApiModel( + description = + "A reference to a specific 'key' within a Secret resource. In some instances, `key` is a required field.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef + v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef = + (V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java new file mode 100644 index 0000000000..3ea5317708 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java @@ -0,0 +1,187 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Use the Akamai DNS zone management API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the Akamai DNS zone management API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Akamai { + public static final String SERIALIZED_NAME_ACCESS_TOKEN_SECRET_REF = "accessTokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef; + + public static final String SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF = "clientSecretSecretRef"; + + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef; + + public static final String SERIALIZED_NAME_CLIENT_TOKEN_SECRET_REF = "clientTokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_CLIENT_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef; + + public static final String SERIALIZED_NAME_SERVICE_CONSUMER_DOMAIN = "serviceConsumerDomain"; + + @SerializedName(SERIALIZED_NAME_SERVICE_CONSUMER_DOMAIN) + private String serviceConsumerDomain; + + public V1alpha2IssuerSpecAcmeDns01Akamai accessTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef) { + + this.accessTokenSecretRef = accessTokenSecretRef; + return this; + } + + /** + * Get accessTokenSecretRef + * + * @return accessTokenSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getAccessTokenSecretRef() { + return accessTokenSecretRef; + } + + public void setAccessTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef) { + this.accessTokenSecretRef = accessTokenSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Akamai clientSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef) { + + this.clientSecretSecretRef = clientSecretSecretRef; + return this; + } + + /** + * Get clientSecretSecretRef + * + * @return clientSecretSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getClientSecretSecretRef() { + return clientSecretSecretRef; + } + + public void setClientSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef) { + this.clientSecretSecretRef = clientSecretSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Akamai clientTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef) { + + this.clientTokenSecretRef = clientTokenSecretRef; + return this; + } + + /** + * Get clientTokenSecretRef + * + * @return clientTokenSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getClientTokenSecretRef() { + return clientTokenSecretRef; + } + + public void setClientTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef) { + this.clientTokenSecretRef = clientTokenSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Akamai serviceConsumerDomain(String serviceConsumerDomain) { + + this.serviceConsumerDomain = serviceConsumerDomain; + return this; + } + + /** + * Get serviceConsumerDomain + * + * @return serviceConsumerDomain + */ + @ApiModelProperty(required = true, value = "") + public String getServiceConsumerDomain() { + return serviceConsumerDomain; + } + + public void setServiceConsumerDomain(String serviceConsumerDomain) { + this.serviceConsumerDomain = serviceConsumerDomain; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Akamai v1alpha2IssuerSpecAcmeDns01Akamai = + (V1alpha2IssuerSpecAcmeDns01Akamai) o; + return Objects.equals( + this.accessTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.accessTokenSecretRef) + && Objects.equals( + this.clientSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.clientSecretSecretRef) + && Objects.equals( + this.clientTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.clientTokenSecretRef) + && Objects.equals( + this.serviceConsumerDomain, v1alpha2IssuerSpecAcmeDns01Akamai.serviceConsumerDomain); + } + + @Override + public int hashCode() { + return Objects.hash( + accessTokenSecretRef, clientSecretSecretRef, clientTokenSecretRef, serviceConsumerDomain); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Akamai {\n"); + sb.append(" accessTokenSecretRef: ") + .append(toIndentedString(accessTokenSecretRef)) + .append("\n"); + sb.append(" clientSecretSecretRef: ") + .append(toIndentedString(clientSecretSecretRef)) + .append("\n"); + sb.append(" clientTokenSecretRef: ") + .append(toIndentedString(clientTokenSecretRef)) + .append("\n"); + sb.append(" serviceConsumerDomain: ") + .append(toIndentedString(serviceConsumerDomain)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java new file mode 100644 index 0000000000..f2ed189375 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java @@ -0,0 +1,323 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** Use the Microsoft Azure DNS API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the Microsoft Azure DNS API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Azuredns { + public static final String SERIALIZED_NAME_CLIENT_I_D = "clientID"; + + @SerializedName(SERIALIZED_NAME_CLIENT_I_D) + private String clientID; + + public static final String SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF = "clientSecretSecretRef"; + + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef; + + /** Gets or Sets environment */ + @JsonAdapter(EnvironmentEnum.Adapter.class) + public enum EnvironmentEnum { + AZUREPUBLICCLOUD("AzurePublicCloud"), + + AZURECHINACLOUD("AzureChinaCloud"), + + AZUREGERMANCLOUD("AzureGermanCloud"), + + AZUREUSGOVERNMENTCLOUD("AzureUSGovernmentCloud"); + + private String value; + + EnvironmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvironmentEnum fromValue(String value) { + for (EnvironmentEnum b : EnvironmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvironmentEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentEnum environment; + + public static final String SERIALIZED_NAME_HOSTED_ZONE_NAME = "hostedZoneName"; + + @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_NAME) + private String hostedZoneName; + + public static final String SERIALIZED_NAME_RESOURCE_GROUP_NAME = "resourceGroupName"; + + @SerializedName(SERIALIZED_NAME_RESOURCE_GROUP_NAME) + private String resourceGroupName; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_I_D = "subscriptionID"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_I_D) + private String subscriptionID; + + public static final String SERIALIZED_NAME_TENANT_I_D = "tenantID"; + + @SerializedName(SERIALIZED_NAME_TENANT_I_D) + private String tenantID; + + public V1alpha2IssuerSpecAcmeDns01Azuredns clientID(String clientID) { + + this.clientID = clientID; + return this; + } + + /** + * if both this and ClientSecret are left unset MSI will be used + * + * @return clientID + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "if both this and ClientSecret are left unset MSI will be used") + public String getClientID() { + return clientID; + } + + public void setClientID(String clientID) { + this.clientID = clientID; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns clientSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef) { + + this.clientSecretSecretRef = clientSecretSecretRef; + return this; + } + + /** + * Get clientSecretSecretRef + * + * @return clientSecretSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef getClientSecretSecretRef() { + return clientSecretSecretRef; + } + + public void setClientSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef) { + this.clientSecretSecretRef = clientSecretSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns environment(EnvironmentEnum environment) { + + this.environment = environment; + return this; + } + + /** + * Get environment + * + * @return environment + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public EnvironmentEnum getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentEnum environment) { + this.environment = environment; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns hostedZoneName(String hostedZoneName) { + + this.hostedZoneName = hostedZoneName; + return this; + } + + /** + * Get hostedZoneName + * + * @return hostedZoneName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getHostedZoneName() { + return hostedZoneName; + } + + public void setHostedZoneName(String hostedZoneName) { + this.hostedZoneName = hostedZoneName; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns resourceGroupName(String resourceGroupName) { + + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get resourceGroupName + * + * @return resourceGroupName + */ + @ApiModelProperty(required = true, value = "") + public String getResourceGroupName() { + return resourceGroupName; + } + + public void setResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns subscriptionID(String subscriptionID) { + + this.subscriptionID = subscriptionID; + return this; + } + + /** + * Get subscriptionID + * + * @return subscriptionID + */ + @ApiModelProperty(required = true, value = "") + public String getSubscriptionID() { + return subscriptionID; + } + + public void setSubscriptionID(String subscriptionID) { + this.subscriptionID = subscriptionID; + } + + public V1alpha2IssuerSpecAcmeDns01Azuredns tenantID(String tenantID) { + + this.tenantID = tenantID; + return this; + } + + /** + * when specifying ClientID and ClientSecret then this field is also needed + * + * @return tenantID + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "when specifying ClientID and ClientSecret then this field is also needed") + public String getTenantID() { + return tenantID; + } + + public void setTenantID(String tenantID) { + this.tenantID = tenantID; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Azuredns v1alpha2IssuerSpecAcmeDns01Azuredns = + (V1alpha2IssuerSpecAcmeDns01Azuredns) o; + return Objects.equals(this.clientID, v1alpha2IssuerSpecAcmeDns01Azuredns.clientID) + && Objects.equals( + this.clientSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Azuredns.clientSecretSecretRef) + && Objects.equals(this.environment, v1alpha2IssuerSpecAcmeDns01Azuredns.environment) + && Objects.equals(this.hostedZoneName, v1alpha2IssuerSpecAcmeDns01Azuredns.hostedZoneName) + && Objects.equals( + this.resourceGroupName, v1alpha2IssuerSpecAcmeDns01Azuredns.resourceGroupName) + && Objects.equals(this.subscriptionID, v1alpha2IssuerSpecAcmeDns01Azuredns.subscriptionID) + && Objects.equals(this.tenantID, v1alpha2IssuerSpecAcmeDns01Azuredns.tenantID); + } + + @Override + public int hashCode() { + return Objects.hash( + clientID, + clientSecretSecretRef, + environment, + hostedZoneName, + resourceGroupName, + subscriptionID, + tenantID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Azuredns {\n"); + sb.append(" clientID: ").append(toIndentedString(clientID)).append("\n"); + sb.append(" clientSecretSecretRef: ") + .append(toIndentedString(clientSecretSecretRef)) + .append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" hostedZoneName: ").append(toIndentedString(hostedZoneName)).append("\n"); + sb.append(" resourceGroupName: ").append(toIndentedString(resourceGroupName)).append("\n"); + sb.append(" subscriptionID: ").append(toIndentedString(subscriptionID)).append("\n"); + sb.append(" tenantID: ").append(toIndentedString(tenantID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java new file mode 100644 index 0000000000..5c3721a35f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java @@ -0,0 +1,123 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** if both this and ClientID are left unset MSI will be used */ +@ApiModel(description = "if both this and ClientID are left unset MSI will be used") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef + v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef = + (V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java new file mode 100644 index 0000000000..365a615578 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java @@ -0,0 +1,153 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Use the Google Cloud DNS API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the Google Cloud DNS API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Clouddns { + public static final String SERIALIZED_NAME_HOSTED_ZONE_NAME = "hostedZoneName"; + + @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_NAME) + private String hostedZoneName; + + public static final String SERIALIZED_NAME_PROJECT = "project"; + + @SerializedName(SERIALIZED_NAME_PROJECT) + private String project; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_SECRET_REF = "serviceAccountSecretRef"; + + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef; + + public V1alpha2IssuerSpecAcmeDns01Clouddns hostedZoneName(String hostedZoneName) { + + this.hostedZoneName = hostedZoneName; + return this; + } + + /** + * HostedZoneName is an optional field that tells cert-manager in which Cloud DNS zone the + * challenge record has to be created. If left empty cert-manager will automatically choose a + * zone. + * + * @return hostedZoneName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "HostedZoneName is an optional field that tells cert-manager in which Cloud DNS zone the challenge record has to be created. If left empty cert-manager will automatically choose a zone.") + public String getHostedZoneName() { + return hostedZoneName; + } + + public void setHostedZoneName(String hostedZoneName) { + this.hostedZoneName = hostedZoneName; + } + + public V1alpha2IssuerSpecAcmeDns01Clouddns project(String project) { + + this.project = project; + return this; + } + + /** + * Get project + * + * @return project + */ + @ApiModelProperty(required = true, value = "") + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public V1alpha2IssuerSpecAcmeDns01Clouddns serviceAccountSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef) { + + this.serviceAccountSecretRef = serviceAccountSecretRef; + return this; + } + + /** + * Get serviceAccountSecretRef + * + * @return serviceAccountSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getServiceAccountSecretRef() { + return serviceAccountSecretRef; + } + + public void setServiceAccountSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef) { + this.serviceAccountSecretRef = serviceAccountSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Clouddns v1alpha2IssuerSpecAcmeDns01Clouddns = + (V1alpha2IssuerSpecAcmeDns01Clouddns) o; + return Objects.equals(this.hostedZoneName, v1alpha2IssuerSpecAcmeDns01Clouddns.hostedZoneName) + && Objects.equals(this.project, v1alpha2IssuerSpecAcmeDns01Clouddns.project) + && Objects.equals( + this.serviceAccountSecretRef, + v1alpha2IssuerSpecAcmeDns01Clouddns.serviceAccountSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(hostedZoneName, project, serviceAccountSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Clouddns {\n"); + sb.append(" hostedZoneName: ").append(toIndentedString(hostedZoneName)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" serviceAccountSecretRef: ") + .append(toIndentedString(serviceAccountSecretRef)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java new file mode 100644 index 0000000000..185112db60 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Use the Cloudflare API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the Cloudflare API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Cloudflare { + public static final String SERIALIZED_NAME_API_KEY_SECRET_REF = "apiKeySecretRef"; + + @SerializedName(SERIALIZED_NAME_API_KEY_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef; + + public static final String SERIALIZED_NAME_API_TOKEN_SECRET_REF = "apiTokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_API_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public V1alpha2IssuerSpecAcmeDns01Cloudflare apiKeySecretRef( + V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef) { + + this.apiKeySecretRef = apiKeySecretRef; + return this; + } + + /** + * Get apiKeySecretRef + * + * @return apiKeySecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef getApiKeySecretRef() { + return apiKeySecretRef; + } + + public void setApiKeySecretRef( + V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef) { + this.apiKeySecretRef = apiKeySecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Cloudflare apiTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef) { + + this.apiTokenSecretRef = apiTokenSecretRef; + return this; + } + + /** + * Get apiTokenSecretRef + * + * @return apiTokenSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef getApiTokenSecretRef() { + return apiTokenSecretRef; + } + + public void setApiTokenSecretRef( + V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef) { + this.apiTokenSecretRef = apiTokenSecretRef; + } + + public V1alpha2IssuerSpecAcmeDns01Cloudflare email(String email) { + + this.email = email; + return this; + } + + /** + * Email of the account, only required when using API key based authentication. + * + * @return email + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Email of the account, only required when using API key based authentication.") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Cloudflare v1alpha2IssuerSpecAcmeDns01Cloudflare = + (V1alpha2IssuerSpecAcmeDns01Cloudflare) o; + return Objects.equals( + this.apiKeySecretRef, v1alpha2IssuerSpecAcmeDns01Cloudflare.apiKeySecretRef) + && Objects.equals( + this.apiTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Cloudflare.apiTokenSecretRef) + && Objects.equals(this.email, v1alpha2IssuerSpecAcmeDns01Cloudflare.email); + } + + @Override + public int hashCode() { + return Objects.hash(apiKeySecretRef, apiTokenSecretRef, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Cloudflare {\n"); + sb.append(" apiKeySecretRef: ").append(toIndentedString(apiKeySecretRef)).append("\n"); + sb.append(" apiTokenSecretRef: ").append(toIndentedString(apiTokenSecretRef)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java new file mode 100644 index 0000000000..daf484c328 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * API key to use to authenticate with Cloudflare. Note: using an API token to authenticate is now + * the recommended method as it allows greater control of permissions. + */ +@ApiModel( + description = + "API key to use to authenticate with Cloudflare. Note: using an API token to authenticate is now the recommended method as it allows greater control of permissions.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef + v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef = + (V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java new file mode 100644 index 0000000000..cbb2792884 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java @@ -0,0 +1,123 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** API token used to authenticate with Cloudflare. */ +@ApiModel(description = "API token used to authenticate with Cloudflare.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef + v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef = + (V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java new file mode 100644 index 0000000000..e374eab6d8 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Use the DigitalOcean DNS API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the DigitalOcean DNS API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Digitalocean { + public static final String SERIALIZED_NAME_TOKEN_SECRET_REF = "tokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef; + + public V1alpha2IssuerSpecAcmeDns01Digitalocean tokenSecretRef( + V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef) { + + this.tokenSecretRef = tokenSecretRef; + return this; + } + + /** + * Get tokenSecretRef + * + * @return tokenSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getTokenSecretRef() { + return tokenSecretRef; + } + + public void setTokenSecretRef(V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef) { + this.tokenSecretRef = tokenSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Digitalocean v1alpha2IssuerSpecAcmeDns01Digitalocean = + (V1alpha2IssuerSpecAcmeDns01Digitalocean) o; + return Objects.equals( + this.tokenSecretRef, v1alpha2IssuerSpecAcmeDns01Digitalocean.tokenSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(tokenSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Digitalocean {\n"); + sb.append(" tokenSecretRef: ").append(toIndentedString(tokenSecretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java new file mode 100644 index 0000000000..32e6f8da03 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java @@ -0,0 +1,195 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Use RFC2136 (\"Dynamic Updates in the Domain Name System\") + * (https://datatracker.ietf.org/doc/rfc2136/) to manage DNS01 challenge records. + */ +@ApiModel( + description = + "Use RFC2136 (\"Dynamic Updates in the Domain Name System\") (https://datatracker.ietf.org/doc/rfc2136/) to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Rfc2136 { + public static final String SERIALIZED_NAME_NAMESERVER = "nameserver"; + + @SerializedName(SERIALIZED_NAME_NAMESERVER) + private String nameserver; + + public static final String SERIALIZED_NAME_TSIG_ALGORITHM = "tsigAlgorithm"; + + @SerializedName(SERIALIZED_NAME_TSIG_ALGORITHM) + private String tsigAlgorithm; + + public static final String SERIALIZED_NAME_TSIG_KEY_NAME = "tsigKeyName"; + + @SerializedName(SERIALIZED_NAME_TSIG_KEY_NAME) + private String tsigKeyName; + + public static final String SERIALIZED_NAME_TSIG_SECRET_SECRET_REF = "tsigSecretSecretRef"; + + @SerializedName(SERIALIZED_NAME_TSIG_SECRET_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef; + + public V1alpha2IssuerSpecAcmeDns01Rfc2136 nameserver(String nameserver) { + + this.nameserver = nameserver; + return this; + } + + /** + * The IP address or hostname of an authoritative DNS server supporting RFC2136 in the form + * host:port. If the host is an IPv6 address it must be enclosed in square brackets (e.g + * [2001:db8::1]) ; port is optional. This field is required. + * + * @return nameserver + */ + @ApiModelProperty( + required = true, + value = + "The IP address or hostname of an authoritative DNS server supporting RFC2136 in the form host:port. If the host is an IPv6 address it must be enclosed in square brackets (e.g [2001:db8::1]) ; port is optional. This field is required.") + public String getNameserver() { + return nameserver; + } + + public void setNameserver(String nameserver) { + this.nameserver = nameserver; + } + + public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigAlgorithm(String tsigAlgorithm) { + + this.tsigAlgorithm = tsigAlgorithm; + return this; + } + + /** + * The TSIG Algorithm configured in the DNS supporting RFC2136. Used only when + * ``tsigSecretSecretRef`` and ``tsigKeyName`` are + * defined. Supported values are (case-insensitive): ``HMACMD5`` (default), + * ``HMACSHA1``, ``HMACSHA256`` or + * ``HMACSHA512``. + * + * @return tsigAlgorithm + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The TSIG Algorithm configured in the DNS supporting RFC2136. Used only when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. Supported values are (case-insensitive): ``HMACMD5`` (default), ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``.") + public String getTsigAlgorithm() { + return tsigAlgorithm; + } + + public void setTsigAlgorithm(String tsigAlgorithm) { + this.tsigAlgorithm = tsigAlgorithm; + } + + public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigKeyName(String tsigKeyName) { + + this.tsigKeyName = tsigKeyName; + return this; + } + + /** + * The TSIG Key name configured in the DNS. If ``tsigSecretSecretRef`` is + * defined, this field is required. + * + * @return tsigKeyName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The TSIG Key name configured in the DNS. If ``tsigSecretSecretRef`` is defined, this field is required.") + public String getTsigKeyName() { + return tsigKeyName; + } + + public void setTsigKeyName(String tsigKeyName) { + this.tsigKeyName = tsigKeyName; + } + + public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef) { + + this.tsigSecretSecretRef = tsigSecretSecretRef; + return this; + } + + /** + * Get tsigSecretSecretRef + * + * @return tsigSecretSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef getTsigSecretSecretRef() { + return tsigSecretSecretRef; + } + + public void setTsigSecretSecretRef( + V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef) { + this.tsigSecretSecretRef = tsigSecretSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Rfc2136 v1alpha2IssuerSpecAcmeDns01Rfc2136 = + (V1alpha2IssuerSpecAcmeDns01Rfc2136) o; + return Objects.equals(this.nameserver, v1alpha2IssuerSpecAcmeDns01Rfc2136.nameserver) + && Objects.equals(this.tsigAlgorithm, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigAlgorithm) + && Objects.equals(this.tsigKeyName, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigKeyName) + && Objects.equals( + this.tsigSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigSecretSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(nameserver, tsigAlgorithm, tsigKeyName, tsigSecretSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Rfc2136 {\n"); + sb.append(" nameserver: ").append(toIndentedString(nameserver)).append("\n"); + sb.append(" tsigAlgorithm: ").append(toIndentedString(tsigAlgorithm)).append("\n"); + sb.append(" tsigKeyName: ").append(toIndentedString(tsigKeyName)).append("\n"); + sb.append(" tsigSecretSecretRef: ") + .append(toIndentedString(tsigSecretSecretRef)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java new file mode 100644 index 0000000000..2d0cd90e4a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The name of the secret containing the TSIG value. If ``tsigKeyName`` is + * defined, this field is required. + */ +@ApiModel( + description = + "The name of the secret containing the TSIG value. If ``tsigKeyName`` is defined, this field is required.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef + v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef = + (V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java new file mode 100644 index 0000000000..b10072bc8d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java @@ -0,0 +1,219 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Use the AWS Route53 API to manage DNS01 challenge records. */ +@ApiModel(description = "Use the AWS Route53 API to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Route53 { + public static final String SERIALIZED_NAME_ACCESS_KEY_I_D = "accessKeyID"; + + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_I_D) + private String accessKeyID; + + public static final String SERIALIZED_NAME_HOSTED_ZONE_I_D = "hostedZoneID"; + + @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_I_D) + private String hostedZoneID; + + public static final String SERIALIZED_NAME_REGION = "region"; + + @SerializedName(SERIALIZED_NAME_REGION) + private String region; + + public static final String SERIALIZED_NAME_ROLE = "role"; + + @SerializedName(SERIALIZED_NAME_ROLE) + private String role; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY_SECRET_REF = + "secretAccessKeySecretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY_SECRET_REF) + private V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef; + + public V1alpha2IssuerSpecAcmeDns01Route53 accessKeyID(String accessKeyID) { + + this.accessKeyID = accessKeyID; + return this; + } + + /** + * The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared + * credentials file or AWS Instance metadata see: + * https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + * + * @return accessKeyID + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials") + public String getAccessKeyID() { + return accessKeyID; + } + + public void setAccessKeyID(String accessKeyID) { + this.accessKeyID = accessKeyID; + } + + public V1alpha2IssuerSpecAcmeDns01Route53 hostedZoneID(String hostedZoneID) { + + this.hostedZoneID = hostedZoneID; + return this; + } + + /** + * If set, the provider will manage only this zone in Route53 and will not do an lookup using the + * route53:ListHostedZonesByName api call. + * + * @return hostedZoneID + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call.") + public String getHostedZoneID() { + return hostedZoneID; + } + + public void setHostedZoneID(String hostedZoneID) { + this.hostedZoneID = hostedZoneID; + } + + public V1alpha2IssuerSpecAcmeDns01Route53 region(String region) { + + this.region = region; + return this; + } + + /** + * Always set the region when using AccessKeyID and SecretAccessKey + * + * @return region + */ + @ApiModelProperty( + required = true, + value = "Always set the region when using AccessKeyID and SecretAccessKey") + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public V1alpha2IssuerSpecAcmeDns01Route53 role(String role) { + + this.role = role; + return this; + } + + /** + * Role is a Role ARN which the Route53 provider will assume using either the explicit credentials + * AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared + * credentials file or AWS Instance metadata + * + * @return role + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata") + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public V1alpha2IssuerSpecAcmeDns01Route53 secretAccessKeySecretRef( + V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef) { + + this.secretAccessKeySecretRef = secretAccessKeySecretRef; + return this; + } + + /** + * Get secretAccessKeySecretRef + * + * @return secretAccessKeySecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef getSecretAccessKeySecretRef() { + return secretAccessKeySecretRef; + } + + public void setSecretAccessKeySecretRef( + V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef) { + this.secretAccessKeySecretRef = secretAccessKeySecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Route53 v1alpha2IssuerSpecAcmeDns01Route53 = + (V1alpha2IssuerSpecAcmeDns01Route53) o; + return Objects.equals(this.accessKeyID, v1alpha2IssuerSpecAcmeDns01Route53.accessKeyID) + && Objects.equals(this.hostedZoneID, v1alpha2IssuerSpecAcmeDns01Route53.hostedZoneID) + && Objects.equals(this.region, v1alpha2IssuerSpecAcmeDns01Route53.region) + && Objects.equals(this.role, v1alpha2IssuerSpecAcmeDns01Route53.role) + && Objects.equals( + this.secretAccessKeySecretRef, + v1alpha2IssuerSpecAcmeDns01Route53.secretAccessKeySecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyID, hostedZoneID, region, role, secretAccessKeySecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Route53 {\n"); + sb.append(" accessKeyID: ").append(toIndentedString(accessKeyID)).append("\n"); + sb.append(" hostedZoneID: ").append(toIndentedString(hostedZoneID)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" secretAccessKeySecretRef: ") + .append(toIndentedString(secretAccessKeySecretRef)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java new file mode 100644 index 0000000000..a9772bfd65 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared + * credentials file or AWS Instance metadata + * https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + */ +@ApiModel( + description = + "The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef + v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef = + (V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.key) + && Objects.equals( + this.name, v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java new file mode 100644 index 0000000000..8ac121477b --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java @@ -0,0 +1,159 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Configure an external webhook based DNS01 challenge solver to manage DNS01 challenge records. */ +@ApiModel( + description = + "Configure an external webhook based DNS01 challenge solver to manage DNS01 challenge records.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeDns01Webhook { + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + private Object config; + + public static final String SERIALIZED_NAME_GROUP_NAME = "groupName"; + + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_SOLVER_NAME = "solverName"; + + @SerializedName(SERIALIZED_NAME_SOLVER_NAME) + private String solverName; + + public V1alpha2IssuerSpecAcmeDns01Webhook config(Object config) { + + this.config = config; + return this; + } + + /** + * Additional configuration that should be passed to the webhook apiserver when challenges are + * processed. This can contain arbitrary JSON data. Secret values should not be specified in this + * stanza. If secret values are needed (e.g. credentials for a DNS service), you should use a + * SecretKeySelector to reference a Secret resource. For details on the schema of this field, + * consult the webhook provider implementation's documentation. + * + * @return config + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Additional configuration that should be passed to the webhook apiserver when challenges are processed. This can contain arbitrary JSON data. Secret values should not be specified in this stanza. If secret values are needed (e.g. credentials for a DNS service), you should use a SecretKeySelector to reference a Secret resource. For details on the schema of this field, consult the webhook provider implementation's documentation.") + public Object getConfig() { + return config; + } + + public void setConfig(Object config) { + this.config = config; + } + + public V1alpha2IssuerSpecAcmeDns01Webhook groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * The API group name that should be used when POSTing ChallengePayload resources to the webhook + * apiserver. This should be the same as the GroupName specified in the webhook provider + * implementation. + * + * @return groupName + */ + @ApiModelProperty( + required = true, + value = + "The API group name that should be used when POSTing ChallengePayload resources to the webhook apiserver. This should be the same as the GroupName specified in the webhook provider implementation.") + public String getGroupName() { + return groupName; + } + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public V1alpha2IssuerSpecAcmeDns01Webhook solverName(String solverName) { + + this.solverName = solverName; + return this; + } + + /** + * The name of the solver to use, as defined in the webhook provider implementation. This will + * typically be the name of the provider, e.g. 'cloudflare'. + * + * @return solverName + */ + @ApiModelProperty( + required = true, + value = + "The name of the solver to use, as defined in the webhook provider implementation. This will typically be the name of the provider, e.g. 'cloudflare'.") + public String getSolverName() { + return solverName; + } + + public void setSolverName(String solverName) { + this.solverName = solverName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeDns01Webhook v1alpha2IssuerSpecAcmeDns01Webhook = + (V1alpha2IssuerSpecAcmeDns01Webhook) o; + return Objects.equals(this.config, v1alpha2IssuerSpecAcmeDns01Webhook.config) + && Objects.equals(this.groupName, v1alpha2IssuerSpecAcmeDns01Webhook.groupName) + && Objects.equals(this.solverName, v1alpha2IssuerSpecAcmeDns01Webhook.solverName); + } + + @Override + public int hashCode() { + return Objects.hash(config, groupName, solverName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeDns01Webhook {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" solverName: ").append(toIndentedString(solverName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java new file mode 100644 index 0000000000..c53e302e64 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java @@ -0,0 +1,213 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** + * ExternalAccountBinding is a reference to a CA external account of the ACME server. If set, upon + * registration cert-manager will attempt to associate the given external account credentials with + * the registered ACME account. + */ +@ApiModel( + description = + "ExternalAccountBinding is a reference to a CA external account of the ACME server. If set, upon registration cert-manager will attempt to associate the given external account credentials with the registered ACME account.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeExternalAccountBinding { + /** + * keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are + * \"HS256\", \"HS384\" and \"HS512\". + */ + @JsonAdapter(KeyAlgorithmEnum.Adapter.class) + public enum KeyAlgorithmEnum { + HS256("HS256"), + + HS384("HS384"), + + HS512("HS512"); + + private String value; + + KeyAlgorithmEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyAlgorithmEnum fromValue(String value) { + for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyAlgorithmEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; + + @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) + private KeyAlgorithmEnum keyAlgorithm; + + public static final String SERIALIZED_NAME_KEY_I_D = "keyID"; + + @SerializedName(SERIALIZED_NAME_KEY_I_D) + private String keyID; + + public static final String SERIALIZED_NAME_KEY_SECRET_REF = "keySecretRef"; + + @SerializedName(SERIALIZED_NAME_KEY_SECRET_REF) + private V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef; + + public V1alpha2IssuerSpecAcmeExternalAccountBinding keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + + this.keyAlgorithm = keyAlgorithm; + return this; + } + + /** + * keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are + * \"HS256\", \"HS384\" and \"HS512\". + * + * @return keyAlgorithm + */ + @ApiModelProperty( + required = true, + value = + "keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are \"HS256\", \"HS384\" and \"HS512\".") + public KeyAlgorithmEnum getKeyAlgorithm() { + return keyAlgorithm; + } + + public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + } + + public V1alpha2IssuerSpecAcmeExternalAccountBinding keyID(String keyID) { + + this.keyID = keyID; + return this; + } + + /** + * keyID is the ID of the CA key that the External Account is bound to. + * + * @return keyID + */ + @ApiModelProperty( + required = true, + value = "keyID is the ID of the CA key that the External Account is bound to.") + public String getKeyID() { + return keyID; + } + + public void setKeyID(String keyID) { + this.keyID = keyID; + } + + public V1alpha2IssuerSpecAcmeExternalAccountBinding keySecretRef( + V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef) { + + this.keySecretRef = keySecretRef; + return this; + } + + /** + * Get keySecretRef + * + * @return keySecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef getKeySecretRef() { + return keySecretRef; + } + + public void setKeySecretRef( + V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef) { + this.keySecretRef = keySecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeExternalAccountBinding v1alpha2IssuerSpecAcmeExternalAccountBinding = + (V1alpha2IssuerSpecAcmeExternalAccountBinding) o; + return Objects.equals( + this.keyAlgorithm, v1alpha2IssuerSpecAcmeExternalAccountBinding.keyAlgorithm) + && Objects.equals(this.keyID, v1alpha2IssuerSpecAcmeExternalAccountBinding.keyID) + && Objects.equals( + this.keySecretRef, v1alpha2IssuerSpecAcmeExternalAccountBinding.keySecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(keyAlgorithm, keyID, keySecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeExternalAccountBinding {\n"); + sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); + sb.append(" keyID: ").append(toIndentedString(keyID)).append("\n"); + sb.append(" keySecretRef: ").append(toIndentedString(keySecretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java new file mode 100644 index 0000000000..638781e70b --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java @@ -0,0 +1,131 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes Secret which holds + * the symmetric MAC key of the External Account Binding. The `key` is the index string + * that is paired with the key data in the Secret and should not be confused with the key data + * itself, or indeed with the External Account Binding keyID above. The secret key stored in the + * Secret **must** be un-padded, base64 URL encoded data. + */ +@ApiModel( + description = + "keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes Secret which holds the symmetric MAC key of the External Account Binding. The `key` is the index string that is paired with the key data in the Secret and should not be confused with the key data itself, or indeed with the External Account Binding keyID above. The secret key stored in the Secret **must** be un-padded, base64 URL encoded data.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef + v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef = + (V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java new file mode 100644 index 0000000000..911a0e3152 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java @@ -0,0 +1,93 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Configures cert-manager to attempt to complete authorizations by performing the HTTP01 challenge + * flow. It is not possible to obtain certificates for wildcard domain names (e.g. + * `*.example.com`) using the HTTP01 challenge mechanism. + */ +@ApiModel( + description = + "Configures cert-manager to attempt to complete authorizations by performing the HTTP01 challenge flow. It is not possible to obtain certificates for wildcard domain names (e.g. `*.example.com`) using the HTTP01 challenge mechanism.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01 { + public static final String SERIALIZED_NAME_INGRESS = "ingress"; + + @SerializedName(SERIALIZED_NAME_INGRESS) + private V1alpha2IssuerSpecAcmeHttp01Ingress ingress; + + public V1alpha2IssuerSpecAcmeHttp01 ingress(V1alpha2IssuerSpecAcmeHttp01Ingress ingress) { + + this.ingress = ingress; + return this; + } + + /** + * Get ingress + * + * @return ingress + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01Ingress getIngress() { + return ingress; + } + + public void setIngress(V1alpha2IssuerSpecAcmeHttp01Ingress ingress) { + this.ingress = ingress; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01 v1alpha2IssuerSpecAcmeHttp01 = (V1alpha2IssuerSpecAcmeHttp01) o; + return Objects.equals(this.ingress, v1alpha2IssuerSpecAcmeHttp01.ingress); + } + + @Override + public int hashCode() { + return Objects.hash(ingress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01 {\n"); + sb.append(" ingress: ").append(toIndentedString(ingress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java new file mode 100644 index 0000000000..f257ea7a3a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java @@ -0,0 +1,218 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The ingress based HTTP01 challenge solver will solve challenges by creating or modifying Ingress + * resources in order to route requests for '/.well-known/acme-challenge/XYZ' to + * 'challenge solver' pods that are provisioned by cert-manager for each Challenge to be + * completed. + */ +@ApiModel( + description = + "The ingress based HTTP01 challenge solver will solve challenges by creating or modifying Ingress resources in order to route requests for '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are provisioned by cert-manager for each Challenge to be completed.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01Ingress { + public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) + private String propertyClass; + + public static final String SERIALIZED_NAME_INGRESS_TEMPLATE = "ingressTemplate"; + + @SerializedName(SERIALIZED_NAME_INGRESS_TEMPLATE) + private V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_POD_TEMPLATE = "podTemplate"; + + @SerializedName(SERIALIZED_NAME_POD_TEMPLATE) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate; + + public static final String SERIALIZED_NAME_SERVICE_TYPE = "serviceType"; + + @SerializedName(SERIALIZED_NAME_SERVICE_TYPE) + private String serviceType; + + public V1alpha2IssuerSpecAcmeHttp01Ingress propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * The ingress class to use when creating Ingress resources to solve ACME challenges that use this + * challenge solver. Only one of 'class' or 'name' may be specified. + * + * @return propertyClass + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The ingress class to use when creating Ingress resources to solve ACME challenges that use this challenge solver. Only one of 'class' or 'name' may be specified.") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public V1alpha2IssuerSpecAcmeHttp01Ingress ingressTemplate( + V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate) { + + this.ingressTemplate = ingressTemplate; + return this; + } + + /** + * Get ingressTemplate + * + * @return ingressTemplate + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate getIngressTemplate() { + return ingressTemplate; + } + + public void setIngressTemplate( + V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate) { + this.ingressTemplate = ingressTemplate; + } + + public V1alpha2IssuerSpecAcmeHttp01Ingress name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the ingress resource that should have ACME challenge solving routes inserted into + * it in order to solve HTTP01 challenges. This is typically used in conjunction with ingress + * controllers like ingress-gce, which maintains a 1:1 mapping between external IPs and ingress + * resources. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of the ingress resource that should have ACME challenge solving routes inserted into it in order to solve HTTP01 challenges. This is typically used in conjunction with ingress controllers like ingress-gce, which maintains a 1:1 mapping between external IPs and ingress resources.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public V1alpha2IssuerSpecAcmeHttp01Ingress podTemplate( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate) { + + this.podTemplate = podTemplate; + return this; + } + + /** + * Get podTemplate + * + * @return podTemplate + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate getPodTemplate() { + return podTemplate; + } + + public void setPodTemplate(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate) { + this.podTemplate = podTemplate; + } + + public V1alpha2IssuerSpecAcmeHttp01Ingress serviceType(String serviceType) { + + this.serviceType = serviceType; + return this; + } + + /** + * Optional service type for Kubernetes solver service + * + * @return serviceType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional service type for Kubernetes solver service") + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01Ingress v1alpha2IssuerSpecAcmeHttp01Ingress = + (V1alpha2IssuerSpecAcmeHttp01Ingress) o; + return Objects.equals(this.propertyClass, v1alpha2IssuerSpecAcmeHttp01Ingress.propertyClass) + && Objects.equals(this.ingressTemplate, v1alpha2IssuerSpecAcmeHttp01Ingress.ingressTemplate) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmeHttp01Ingress.name) + && Objects.equals(this.podTemplate, v1alpha2IssuerSpecAcmeHttp01Ingress.podTemplate) + && Objects.equals(this.serviceType, v1alpha2IssuerSpecAcmeHttp01Ingress.serviceType); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass, ingressTemplate, name, podTemplate, serviceType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01Ingress {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" ingressTemplate: ").append(toIndentedString(ingressTemplate)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" podTemplate: ").append(toIndentedString(podTemplate)).append("\n"); + sb.append(" serviceType: ").append(toIndentedString(serviceType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java new file mode 100644 index 0000000000..08c343e348 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Optional ingress template used to configure the ACME challenge solver ingress used for HTTP01 + * challenges + */ +@ApiModel( + description = + "Optional ingress template used to configure the ACME challenge solver ingress used for HTTP01 challenges") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate { + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata; + + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate metadata( + V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata getMetadata() { + return metadata; + } + + public void setMetadata(V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate + v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate = + (V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate) o; + return Objects.equals( + this.metadata, v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java new file mode 100644 index 0000000000..b90b48c4ce --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java @@ -0,0 +1,150 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * ObjectMeta overrides for the ingress used to solve HTTP01 challenges. Only the 'labels' + * and 'annotations' fields may be set. If labels or annotations overlap with in-built + * values, the values here will override the in-built values. + */ +@ApiModel( + description = + "ObjectMeta overrides for the ingress used to solve HTTP01 challenges. Only the 'labels' and 'annotations' fields may be set. If labels or annotations overlap with in-built values, the values here will override the in-built values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata { + public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) + private Map annotations = null; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata annotations( + Map annotations) { + + this.annotations = annotations; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata putAnnotationsItem( + String key, String annotationsItem) { + if (this.annotations == null) { + this.annotations = new HashMap(); + } + this.annotations.put(key, annotationsItem); + return this; + } + + /** + * Annotations that should be added to the created ACME HTTP01 solver ingress. + * + * @return annotations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Annotations that should be added to the created ACME HTTP01 solver ingress.") + public Map getAnnotations() { + return annotations; + } + + public void setAnnotations(Map annotations) { + this.annotations = annotations; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata labels( + Map labels) { + + this.labels = labels; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata putLabelsItem( + String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Labels that should be added to the created ACME HTTP01 solver ingress. + * + * @return labels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Labels that should be added to the created ACME HTTP01 solver ingress.") + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata + v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata = + (V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata) o; + return Objects.equals( + this.annotations, + v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.annotations) + && Objects.equals( + this.labels, v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.labels); + } + + @Override + public int hashCode() { + return Objects.hash(annotations, labels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata {\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java new file mode 100644 index 0000000000..9b2d92e209 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java @@ -0,0 +1,122 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Optional pod template used to configure the ACME challenge solver pods used for HTTP01 challenges + */ +@ApiModel( + description = + "Optional pod template used to configure the ACME challenge solver pods used for HTTP01 challenges") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate { + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate metadata( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata getMetadata() { + return metadata; + } + + public void setMetadata(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata) { + this.metadata = metadata; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate spec( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec) { + this.spec = spec; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate) o; + return Objects.equals(this.metadata, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.metadata) + && Objects.equals(this.spec, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.spec); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, spec); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java new file mode 100644 index 0000000000..c22200b0ac --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * ObjectMeta overrides for the pod used to solve HTTP01 challenges. Only the 'labels' and + * 'annotations' fields may be set. If labels or annotations overlap with in-built values, + * the values here will override the in-built values. + */ +@ApiModel( + description = + "ObjectMeta overrides for the pod used to solve HTTP01 challenges. Only the 'labels' and 'annotations' fields may be set. If labels or annotations overlap with in-built values, the values here will override the in-built values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata { + public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; + + @SerializedName(SERIALIZED_NAME_ANNOTATIONS) + private Map annotations = null; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + private Map labels = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata annotations( + Map annotations) { + + this.annotations = annotations; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata putAnnotationsItem( + String key, String annotationsItem) { + if (this.annotations == null) { + this.annotations = new HashMap(); + } + this.annotations.put(key, annotationsItem); + return this; + } + + /** + * Annotations that should be added to the create ACME HTTP01 solver pods. + * + * @return annotations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Annotations that should be added to the create ACME HTTP01 solver pods.") + public Map getAnnotations() { + return annotations; + } + + public void setAnnotations(Map annotations) { + this.annotations = annotations; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata labels(Map labels) { + + this.labels = labels; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata putLabelsItem( + String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Labels that should be added to the created ACME HTTP01 solver pods. + * + * @return labels + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Labels that should be added to the created ACME HTTP01 solver pods.") + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata) o; + return Objects.equals( + this.annotations, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.annotations) + && Objects.equals( + this.labels, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.labels); + } + + @Override + public int hashCode() { + return Objects.hash(annotations, labels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata {\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java new file mode 100644 index 0000000000..83ca35f270 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java @@ -0,0 +1,185 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * PodSpec defines overrides for the HTTP01 challenge solver pod. Only the 'nodeSelector', + * 'affinity' and 'tolerations' fields are supported currently. All other fields + * will be ignored. + */ +@ApiModel( + description = + "PodSpec defines overrides for the HTTP01 challenge solver pod. Only the 'nodeSelector', 'affinity' and 'tolerations' fields are supported currently. All other fields will be ignored.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec { + public static final String SERIALIZED_NAME_AFFINITY = "affinity"; + + @SerializedName(SERIALIZED_NAME_AFFINITY) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity; + + public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector"; + + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR) + private Map nodeSelector = null; + + public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations"; + + @SerializedName(SERIALIZED_NAME_TOLERATIONS) + private List tolerations = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec affinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity) { + + this.affinity = affinity; + return this; + } + + /** + * Get affinity + * + * @return affinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity getAffinity() { + return affinity; + } + + public void setAffinity(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity) { + this.affinity = affinity; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec nodeSelector( + Map nodeSelector) { + + this.nodeSelector = nodeSelector; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec putNodeSelectorItem( + String key, String nodeSelectorItem) { + if (this.nodeSelector == null) { + this.nodeSelector = new HashMap(); + } + this.nodeSelector.put(key, nodeSelectorItem); + return this; + } + + /** + * NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must + * match a node's labels for the pod to be scheduled on that node. More info: + * https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + * + * @return nodeSelector + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/") + public Map getNodeSelector() { + return nodeSelector; + } + + public void setNodeSelector(Map nodeSelector) { + this.nodeSelector = nodeSelector; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec tolerations( + List tolerations) { + + this.tolerations = tolerations; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec addTolerationsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations tolerationsItem) { + if (this.tolerations == null) { + this.tolerations = + new ArrayList(); + } + this.tolerations.add(tolerationsItem); + return this; + } + + /** + * If specified, the pod's tolerations. + * + * @return tolerations + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If specified, the pod's tolerations.") + public List getTolerations() { + return tolerations; + } + + public void setTolerations( + List tolerations) { + this.tolerations = tolerations; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec) o; + return Objects.equals( + this.affinity, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.affinity) + && Objects.equals( + this.nodeSelector, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.nodeSelector) + && Objects.equals( + this.tolerations, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.tolerations); + } + + @Override + public int hashCode() { + return Objects.hash(affinity, nodeSelector, tolerations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec {\n"); + sb.append(" affinity: ").append(toIndentedString(affinity)).append("\n"); + sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n"); + sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java new file mode 100644 index 0000000000..f0725138db --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java @@ -0,0 +1,158 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** If specified, the pod's scheduling constraints */ +@ApiModel(description = "If specified, the pod's scheduling constraints") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity { + public static final String SERIALIZED_NAME_NODE_AFFINITY = "nodeAffinity"; + + @SerializedName(SERIALIZED_NAME_NODE_AFFINITY) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity; + + public static final String SERIALIZED_NAME_POD_AFFINITY = "podAffinity"; + + @SerializedName(SERIALIZED_NAME_POD_AFFINITY) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity; + + public static final String SERIALIZED_NAME_POD_ANTI_AFFINITY = "podAntiAffinity"; + + @SerializedName(SERIALIZED_NAME_POD_ANTI_AFFINITY) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity nodeAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity) { + + this.nodeAffinity = nodeAffinity; + return this; + } + + /** + * Get nodeAffinity + * + * @return nodeAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity getNodeAffinity() { + return nodeAffinity; + } + + public void setNodeAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity) { + this.nodeAffinity = nodeAffinity; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity podAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity) { + + this.podAffinity = podAffinity; + return this; + } + + /** + * Get podAffinity + * + * @return podAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity getPodAffinity() { + return podAffinity; + } + + public void setPodAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity) { + this.podAffinity = podAffinity; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity podAntiAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity) { + + this.podAntiAffinity = podAntiAffinity; + return this; + } + + /** + * Get podAntiAffinity + * + * @return podAntiAffinity + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + getPodAntiAffinity() { + return podAntiAffinity; + } + + public void setPodAntiAffinity( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity) { + this.podAntiAffinity = podAntiAffinity; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity) o; + return Objects.equals( + this.nodeAffinity, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.nodeAffinity) + && Objects.equals( + this.podAffinity, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.podAffinity) + && Objects.equals( + this.podAntiAffinity, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.podAntiAffinity); + } + + @Override + public int hashCode() { + return Objects.hash(nodeAffinity, podAffinity, podAntiAffinity); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity {\n"); + sb.append(" nodeAffinity: ").append(toIndentedString(nodeAffinity)).append("\n"); + sb.append(" podAffinity: ").append(toIndentedString(podAffinity)).append("\n"); + sb.append(" podAntiAffinity: ").append(toIndentedString(podAntiAffinity)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java new file mode 100644 index 0000000000..08e92b4a12 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java @@ -0,0 +1,179 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Describes node affinity scheduling rules for the pod. */ +@ApiModel(description = "Describes node affinity scheduling rules for the pod.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + preferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * affinity expressions, etc.), compute a sum by iterating through the elements of this field and + * adding \"weight\" to the sum if the node matches the corresponding matchExpressions; + * the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + requiredDuringSchedulingIgnoredDuringExecution( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + /** + * Get requiredDuringSchedulingIgnoredDuringExecution + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + .preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity + .requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java new file mode 100644 index 0000000000..2daf27601f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java @@ -0,0 +1,174 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** A node selector term, associated with the corresponding weight. */ +@ApiModel(description = "A node selector term, associated with the corresponding weight.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions = null; + + public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; + + @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + matchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + addMatchExpressionsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * A list of node selector requirements by node's labels. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's labels.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + matchFields( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields) { + + this.matchFields = matchFields; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + addMatchFieldsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + matchFieldsItem) { + if (this.matchFields == null) { + this.matchFields = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); + } + this.matchFields.add(matchFieldsItem); + return this; + } + + /** + * A list of node selector requirements by node's fields. + * + * @return matchFields + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's fields.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + getMatchFields() { + return matchFields; + } + + public void setMatchFields( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields) { + this.matchFields = matchFields; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference) o; + return Objects.equals( + this.matchExpressions, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + .matchExpressions) + && Objects.equals( + this.matchFields, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + .matchFields); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchFields: ").append(toIndentedString(matchFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java new file mode 100644 index 0000000000..94856bdb8f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java @@ -0,0 +1,187 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A node selector requirement is a selector that contains values, a key, and an operator that + * relates the key and values. + */ +@ApiModel( + description = + "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + + @SerializedName(SERIALIZED_NAME_VALUES) + private List values = null; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + key(String key) { + + this.key = key; + return this; + } + + /** + * The label key that the selector applies to. + * + * @return key + */ + @ApiModelProperty(required = true, value = "The label key that the selector applies to.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, + * DoesNotExist. Gt, and Lt. + * + * @return operator + */ + @ApiModelProperty( + required = true, + value = + "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + values(List values) { + + this.values = values; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(valuesItem); + return this; + } + + /** + * An array of string values. If the operator is In or NotIn, the values array must be non-empty. + * If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is + * Gt or Lt, the values array must have a single element, which will be interpreted as an integer. + * This array is replaced during a strategic merge patch. + * + * @return values + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.") + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions) + o; + return Objects.equals( + this.key, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + .key) + && Objects.equals( + this.operator, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + .operator) + && Objects.equals( + this.values, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + .values); + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..d37c79a125 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,141 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a + * no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). + */ +@ApiModel( + description = + "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_PREFERENCE = "preference"; + + @SerializedName(SERIALIZED_NAME_PREFERENCE) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + preference; + + public static final String SERIALIZED_NAME_WEIGHT = "weight"; + + @SerializedName(SERIALIZED_NAME_WEIGHT) + private Integer weight; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + preference( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + preference) { + + this.preference = preference; + return this; + } + + /** + * Get preference + * + * @return preference + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference + getPreference() { + return preference; + } + + public void setPreference( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference preference) { + this.preference = preference; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + weight(Integer weight) { + + this.weight = weight; + return this; + } + + /** + * Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + * + * @return weight + */ + @ApiModelProperty( + required = true, + value = + "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution) + o; + return Objects.equals( + this.preference, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + .preference) + && Objects.equals( + this.weight, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution + .weight); + } + + @Override + public int hashCode() { + return Objects.hash(preference, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" preference: ").append(toIndentedString(preference)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..d068374c73 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * If the affinity requirements specified by this field are not met at scheduling time, the pod will + * not be scheduled onto the node. If the affinity requirements specified by this field cease to be + * met at some point during pod execution (e.g. due to an update), the system may or may not try to + * eventually evict the pod from its node. + */ +@ApiModel( + description = + "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_NODE_SELECTOR_TERMS = "nodeSelectorTerms"; + + @SerializedName(SERIALIZED_NAME_NODE_SELECTOR_TERMS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>(); + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + nodeSelectorTerms( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms) { + + this.nodeSelectorTerms = nodeSelectorTerms; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + addNodeSelectorTermsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + nodeSelectorTermsItem) { + this.nodeSelectorTerms.add(nodeSelectorTermsItem); + return this; + } + + /** + * Required. A list of node selector terms. The terms are ORed. + * + * @return nodeSelectorTerms + */ + @ApiModelProperty( + required = true, + value = "Required. A list of node selector terms. The terms are ORed.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + getNodeSelectorTerms() { + return nodeSelectorTerms; + } + + public void setNodeSelectorTerms( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> + nodeSelectorTerms) { + this.nodeSelectorTerms = nodeSelectorTerms; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) + o; + return Objects.equals( + this.nodeSelectorTerms, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution + .nodeSelectorTerms); + } + + @Override + public int hashCode() { + return Objects.hash(nodeSelectorTerms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" nodeSelectorTerms: ").append(toIndentedString(nodeSelectorTerms)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java new file mode 100644 index 0000000000..ab5e0356de --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java @@ -0,0 +1,185 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A null or empty node selector term matches no objects. The requirements of them are ANDed. The + * TopologySelectorTerm type implements a subset of the NodeSelectorTerm. + */ +@ApiModel( + description = + "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions = null; + + public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; + + @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields = null; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + matchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + addMatchExpressionsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * A list of node selector requirements by node's labels. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's labels.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + matchFields( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields) { + + this.matchFields = matchFields; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + addMatchFieldsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions + matchFieldsItem) { + if (this.matchFields == null) { + this.matchFields = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); + } + this.matchFields.add(matchFieldsItem); + return this; + } + + /** + * A list of node selector requirements by node's fields. + * + * @return matchFields + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of node selector requirements by node's fields.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + getMatchFields() { + return matchFields; + } + + public void setMatchFields( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> + matchFields) { + this.matchFields = matchFields; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms) + o; + return Objects.equals( + this.matchExpressions, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + .matchExpressions) + && Objects.equals( + this.matchFields, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms + .matchFields); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchFields: ").append(toIndentedString(matchFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java new file mode 100644 index 0000000000..ad512ea28d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java @@ -0,0 +1,207 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as + * some other pod(s)). + */ +@ApiModel( + description = + "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + preferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * affinity expressions, etc.), compute a sum by iterating through the elements of this field and + * adding \"weight\" to the sum if the node has pods which matches the corresponding + * podAffinityTerm; the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + requiredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + addRequiredDuringSchedulingIgnoredDuringExecutionItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { + this.requiredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); + } + this.requiredDuringSchedulingIgnoredDuringExecution.add( + requiredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * If the affinity requirements specified by this field are not met at scheduling time, the pod + * will not be scheduled onto the node. If the affinity requirements specified by this field cease + * to be met at some point during pod execution (e.g. due to a pod label update), the system may + * or may not try to eventually evict the pod from its node. When there are multiple elements, the + * lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be + * satisfied. + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + .preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity + .requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java new file mode 100644 index 0000000000..414717b6dc --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Required. A pod affinity term, associated with the corresponding weight. */ +@ApiModel(description = "Required. A pod affinity term, associated with the corresponding weight.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm { + public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; + + @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) + private + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector; + + public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; + + @SerializedName(SERIALIZED_NAME_NAMESPACES) + private List namespaces = null; + + public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; + + @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) + private String topologyKey; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + labelSelector( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector) { + + this.labelSelector = labelSelector; + return this; + } + + /** + * Get labelSelector + * + * @return labelSelector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + getLabelSelector() { + return labelSelector; + } + + public void setLabelSelector( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector) { + this.labelSelector = labelSelector; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + namespaces(List namespaces) { + + this.namespaces = namespaces; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + addNamespacesItem(String namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new ArrayList(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * namespaces specifies which namespaces the labelSelector applies to (matches against); null or + * empty list means \"this pod's namespace\" + * + * @return namespaces + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") + public List getNamespaces() { + return namespaces; + } + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + topologyKey(String topologyKey) { + + this.topologyKey = topologyKey; + return this; + } + + /** + * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods + * matching the labelSelector in the specified namespaces, where co-located is defined as running + * on a node whose value of the label with key topologyKey matches that of any node on which any + * of the selected pods is running. Empty topologyKey is not allowed. + * + * @return topologyKey + */ + @ApiModelProperty( + required = true, + value = + "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") + public String getTopologyKey() { + return topologyKey; + } + + public void setTopologyKey(String topologyKey) { + this.topologyKey = topologyKey; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm) + o; + return Objects.equals( + this.labelSelector, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + .labelSelector) + && Objects.equals( + this.namespaces, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + .namespaces) + && Objects.equals( + this.topologyKey, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + .topologyKey); + } + + @Override + public int hashCode() { + return Objects.hash(labelSelector, namespaces, topologyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm {\n"); + sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java new file mode 100644 index 0000000000..b2101c508d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java @@ -0,0 +1,175 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A label query over a set of resources, in this case pods. */ +@ApiModel(description = "A label query over a set of resources, in this case pods.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector { + public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; + + @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> + matchExpressions = null; + + public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) + private Map matchLabels = null; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + matchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> + matchExpressions) { + + this.matchExpressions = matchExpressions; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + addMatchExpressionsItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + matchExpressionsItem) { + if (this.matchExpressions == null) { + this.matchExpressions = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions>(); + } + this.matchExpressions.add(matchExpressionsItem); + return this; + } + + /** + * matchExpressions is a list of label selector requirements. The requirements are ANDed. + * + * @return matchExpressions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchExpressions is a list of label selector requirements. The requirements are ANDed.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> + getMatchExpressions() { + return matchExpressions; + } + + public void setMatchExpressions( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> + matchExpressions) { + this.matchExpressions = matchExpressions; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + matchLabels(Map matchLabels) { + + this.matchLabels = matchLabels; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + putMatchLabelsItem(String key, String matchLabelsItem) { + if (this.matchLabels == null) { + this.matchLabels = new HashMap(); + } + this.matchLabels.put(key, matchLabelsItem); + return this; + } + + /** + * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is + * equivalent to an element of matchExpressions, whose key field is \"key\", the + * operator is \"In\", and the values array contains only \"value\". The + * requirements are ANDed. + * + * @return matchLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") + public Map getMatchLabels() { + return matchLabels; + } + + public void setMatchLabels(Map matchLabels) { + this.matchLabels = matchLabels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector) + o; + return Objects.equals( + this.matchExpressions, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + .matchExpressions) + && Objects.equals( + this.matchLabels, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + .matchLabels); + } + + @Override + public int hashCode() { + return Objects.hash(matchExpressions, matchLabels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector {\n"); + sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); + sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java new file mode 100644 index 0000000000..7852e45780 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A label selector requirement is a selector that contains values, a key, and an operator that + * relates the key and values. + */ +@ApiModel( + description = + "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + + @SerializedName(SERIALIZED_NAME_VALUES) + private List values = null; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + key(String key) { + + this.key = key; + return this; + } + + /** + * key is the label key that the selector applies to. + * + * @return key + */ + @ApiModelProperty(required = true, value = "key is the label key that the selector applies to.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * operator represents a key's relationship to a set of values. Valid operators are In, NotIn, + * Exists and DoesNotExist. + * + * @return operator + */ + @ApiModelProperty( + required = true, + value = + "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + values(List values) { + + this.values = values; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(valuesItem); + return this; + } + + /** + * values is an array of string values. If the operator is In or NotIn, the values array must be + * non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This + * array is replaced during a strategic merge patch. + * + * @return values + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.") + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions) + o; + return Objects.equals( + this.key, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + .key) + && Objects.equals( + this.operator, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + .operator) + && Objects.equals( + this.values, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions + .values); + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..d42c3c77b5 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,142 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the + * most preferred node(s) + */ +@ApiModel( + description = + "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_POD_AFFINITY_TERM = "podAffinityTerm"; + + @SerializedName(SERIALIZED_NAME_POD_AFFINITY_TERM) + private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + podAffinityTerm; + + public static final String SERIALIZED_NAME_WEIGHT = "weight"; + + @SerializedName(SERIALIZED_NAME_WEIGHT) + private Integer weight; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + podAffinityTerm( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + podAffinityTerm) { + + this.podAffinityTerm = podAffinityTerm; + return this; + } + + /** + * Get podAffinityTerm + * + * @return podAffinityTerm + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + getPodAffinityTerm() { + return podAffinityTerm; + } + + public void setPodAffinityTerm( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm + podAffinityTerm) { + this.podAffinityTerm = podAffinityTerm; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + weight(Integer weight) { + + this.weight = weight; + return this; + } + + /** + * weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + * + * @return weight + */ + @ApiModelProperty( + required = true, + value = + "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution) + o; + return Objects.equals( + this.podAffinityTerm, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + .podAffinityTerm) + && Objects.equals( + this.weight, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + .weight); + } + + @Override + public int hashCode() { + return Objects.hash(podAffinityTerm, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" podAffinityTerm: ").append(toIndentedString(podAffinityTerm)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java new file mode 100644 index 0000000000..2a70aba8fc --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java @@ -0,0 +1,198 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Defines a set of pods (namely those matching the labelSelector relative to the given + * namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) + * with, where co-located is defined as running on a node whose value of the label with key + * <topologyKey> matches that of any node on which a pod of the set of pods is running + */ +@ApiModel( + description = + "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public +class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution { + public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; + + @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) + private + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector; + + public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; + + @SerializedName(SERIALIZED_NAME_NAMESPACES) + private List namespaces = null; + + public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; + + @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) + private String topologyKey; + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + labelSelector( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector) { + + this.labelSelector = labelSelector; + return this; + } + + /** + * Get labelSelector + * + * @return labelSelector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + getLabelSelector() { + return labelSelector; + } + + public void setLabelSelector( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector + labelSelector) { + this.labelSelector = labelSelector; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + namespaces(List namespaces) { + + this.namespaces = namespaces; + return this; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + addNamespacesItem(String namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new ArrayList(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * namespaces specifies which namespaces the labelSelector applies to (matches against); null or + * empty list means \"this pod's namespace\" + * + * @return namespaces + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") + public List getNamespaces() { + return namespaces; + } + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + public + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + topologyKey(String topologyKey) { + + this.topologyKey = topologyKey; + return this; + } + + /** + * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods + * matching the labelSelector in the specified namespaces, where co-located is defined as running + * on a node whose value of the label with key topologyKey matches that of any node on which any + * of the selected pods is running. Empty topologyKey is not allowed. + * + * @return topologyKey + */ + @ApiModelProperty( + required = true, + value = + "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") + public String getTopologyKey() { + return topologyKey; + } + + public void setTopologyKey(String topologyKey) { + this.topologyKey = topologyKey; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution) + o; + return Objects.equals( + this.labelSelector, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .labelSelector) + && Objects.equals( + this.namespaces, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .namespaces) + && Objects.equals( + this.topologyKey, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + .topologyKey); + } + + @Override + public int hashCode() { + return Objects.hash(labelSelector, namespaces, topologyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); + sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java new file mode 100644 index 0000000000..83fd3438a4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java @@ -0,0 +1,208 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, + * etc. as some other pod(s)). + */ +@ApiModel( + description = + "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity { + public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "preferredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution = null; + + public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = + "requiredDuringSchedulingIgnoredDuringExecution"; + + @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) + private List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution = null; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + preferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + addPreferredDuringSchedulingIgnoredDuringExecutionItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution + preferredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { + this.preferredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); + } + this.preferredDuringSchedulingIgnoredDuringExecution.add( + preferredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions + * specified by this field, but it may choose a node that violates one or more of the expressions. + * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node + * that meets all of the scheduling requirements (resource request, requiredDuringScheduling + * anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field + * and adding \"weight\" to the sum if the node has pods which matches the corresponding + * podAffinityTerm; the node(s) with the highest sum are the most preferred. + * + * @return preferredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + getPreferredDuringSchedulingIgnoredDuringExecution() { + return preferredDuringSchedulingIgnoredDuringExecution; + } + + public void setPreferredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> + preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = + preferredDuringSchedulingIgnoredDuringExecution; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + requiredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution) { + + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + return this; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + addRequiredDuringSchedulingIgnoredDuringExecutionItem( + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution + requiredDuringSchedulingIgnoredDuringExecutionItem) { + if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { + this.requiredDuringSchedulingIgnoredDuringExecution = + new ArrayList< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); + } + this.requiredDuringSchedulingIgnoredDuringExecution.add( + requiredDuringSchedulingIgnoredDuringExecutionItem); + return this; + } + + /** + * If the anti-affinity requirements specified by this field are not met at scheduling time, the + * pod will not be scheduled onto the node. If the anti-affinity requirements specified by this + * field cease to be met at some point during pod execution (e.g. due to a pod label update), the + * system may or may not try to eventually evict the pod from its node. When there are multiple + * elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all + * terms must be satisfied. + * + * @return requiredDuringSchedulingIgnoredDuringExecution + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") + public List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + getRequiredDuringSchedulingIgnoredDuringExecution() { + return requiredDuringSchedulingIgnoredDuringExecution; + } + + public void setRequiredDuringSchedulingIgnoredDuringExecution( + List< + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> + requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = + requiredDuringSchedulingIgnoredDuringExecution; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity) o; + return Objects.equals( + this.preferredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + .preferredDuringSchedulingIgnoredDuringExecution) + && Objects.equals( + this.requiredDuringSchedulingIgnoredDuringExecution, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity + .requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public int hashCode() { + return Objects.hash( + preferredDuringSchedulingIgnoredDuringExecution, + requiredDuringSchedulingIgnoredDuringExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity {\n"); + sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") + .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java new file mode 100644 index 0000000000..bd0c65dbb3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java @@ -0,0 +1,231 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The pod this Toleration is attached to tolerates any taint that matches the triple + * <key,value,effect> using the matching operator <operator>. + */ +@ApiModel( + description = + "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations { + public static final String SERIALIZED_NAME_EFFECT = "effect"; + + @SerializedName(SERIALIZED_NAME_EFFECT) + private String effect; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + + @SerializedName(SERIALIZED_NAME_OPERATOR) + private String operator; + + public static final String SERIALIZED_NAME_TOLERATION_SECONDS = "tolerationSeconds"; + + @SerializedName(SERIALIZED_NAME_TOLERATION_SECONDS) + private Long tolerationSeconds; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations effect(String effect) { + + this.effect = effect; + return this; + } + + /** + * Effect indicates the taint effect to match. Empty means match all taint effects. When + * specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + * + * @return effect + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.") + public String getEffect() { + return effect; + } + + public void setEffect(String effect) { + this.effect = effect; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations key(String key) { + + this.key = key; + return this; + } + + /** + * Key is the taint key that the toleration applies to. Empty means match all taint keys. If the + * key is empty, operator must be Exists; this combination means to match all values and all keys. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations operator(String operator) { + + this.operator = operator; + return this; + } + + /** + * Operator represents a key's relationship to the value. Valid operators are Exists and + * Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can + * tolerate all taints of a particular category. + * + * @return operator + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations tolerationSeconds( + Long tolerationSeconds) { + + this.tolerationSeconds = tolerationSeconds; + return this; + } + + /** + * TolerationSeconds represents the period of time the toleration (which must be of effect + * NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, + * which means tolerate the taint forever (do not evict). Zero and negative values will be treated + * as 0 (evict immediately) by the system. + * + * @return tolerationSeconds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.") + public Long getTolerationSeconds() { + return tolerationSeconds; + } + + public void setTolerationSeconds(Long tolerationSeconds) { + this.tolerationSeconds = tolerationSeconds; + } + + public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations value(String value) { + + this.value = value; + return this; + } + + /** + * Value is the taint value the toleration matches to. If the operator is Exists, the value should + * be empty, otherwise just a regular string. + * + * @return value + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations = + (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations) o; + return Objects.equals( + this.effect, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.effect) + && Objects.equals( + this.key, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.key) + && Objects.equals( + this.operator, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.operator) + && Objects.equals( + this.tolerationSeconds, + v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.tolerationSeconds) + && Objects.equals( + this.value, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.value); + } + + @Override + public int hashCode() { + return Objects.hash(effect, key, operator, tolerationSeconds, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations {\n"); + sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" tolerationSeconds: ").append(toIndentedString(tolerationSeconds)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java new file mode 100644 index 0000000000..16e179cd37 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java @@ -0,0 +1,129 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PrivateKey is the name of a Kubernetes Secret resource that will be used to store the + * automatically generated ACME account private key. Optionally, a `key` may be specified + * to select a specific entry within the named Secret resource. If `key` is not specified, + * a default of `tls.key` will be used. + */ +@ApiModel( + description = + "PrivateKey is the name of a Kubernetes Secret resource that will be used to store the automatically generated ACME account private key. Optionally, a `key` may be specified to select a specific entry within the named Secret resource. If `key` is not specified, a default of `tls.key` will be used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmePrivateKeySecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecAcmePrivateKeySecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecAcmePrivateKeySecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmePrivateKeySecretRef v1alpha2IssuerSpecAcmePrivateKeySecretRef = + (V1alpha2IssuerSpecAcmePrivateKeySecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecAcmePrivateKeySecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecAcmePrivateKeySecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmePrivateKeySecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java new file mode 100644 index 0000000000..d43fb31a99 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Selector selects a set of DNSNames on the Certificate resource that should be solved using this + * challenge solver. If not specified, the solver will be treated as the 'default' solver + * with the lowest priority, i.e. if any other solver has a more specific match, it will be used + * instead. + */ +@ApiModel( + description = + "Selector selects a set of DNSNames on the Certificate resource that should be solved using this challenge solver. If not specified, the solver will be treated as the 'default' solver with the lowest priority, i.e. if any other solver has a more specific match, it will be used instead.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeSelector { + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = null; + + public static final String SERIALIZED_NAME_DNS_ZONES = "dnsZones"; + + @SerializedName(SERIALIZED_NAME_DNS_ZONES) + private List dnsZones = null; + + public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; + + @SerializedName(SERIALIZED_NAME_MATCH_LABELS) + private Map matchLabels = null; + + public V1alpha2IssuerSpecAcmeSelector dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1alpha2IssuerSpecAcmeSelector addDnsNamesItem(String dnsNamesItem) { + if (this.dnsNames == null) { + this.dnsNames = new ArrayList(); + } + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * List of DNSNames that this solver will be used to solve. If specified and a match is found, a + * dnsNames selector will take precedence over a dnsZones selector. If multiple solvers match with + * the same dnsNames value, the solver with the most matching labels in matchLabels will be + * selected. If neither has more matches, the solver defined earlier in the list will be selected. + * + * @return dnsNames + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of DNSNames that this solver will be used to solve. If specified and a match is found, a dnsNames selector will take precedence over a dnsZones selector. If multiple solvers match with the same dnsNames value, the solver with the most matching labels in matchLabels will be selected. If neither has more matches, the solver defined earlier in the list will be selected.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1alpha2IssuerSpecAcmeSelector dnsZones(List dnsZones) { + + this.dnsZones = dnsZones; + return this; + } + + public V1alpha2IssuerSpecAcmeSelector addDnsZonesItem(String dnsZonesItem) { + if (this.dnsZones == null) { + this.dnsZones = new ArrayList(); + } + this.dnsZones.add(dnsZonesItem); + return this; + } + + /** + * List of DNSZones that this solver will be used to solve. The most specific DNS zone match + * specified here will take precedence over other DNS zone matches, so a solver specifying + * sys.example.com will be selected over one specifying example.com for the domain + * www.sys.example.com. If multiple solvers match with the same dnsZones value, the solver with + * the most matching labels in matchLabels will be selected. If neither has more matches, the + * solver defined earlier in the list will be selected. + * + * @return dnsZones + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of DNSZones that this solver will be used to solve. The most specific DNS zone match specified here will take precedence over other DNS zone matches, so a solver specifying sys.example.com will be selected over one specifying example.com for the domain www.sys.example.com. If multiple solvers match with the same dnsZones value, the solver with the most matching labels in matchLabels will be selected. If neither has more matches, the solver defined earlier in the list will be selected.") + public List getDnsZones() { + return dnsZones; + } + + public void setDnsZones(List dnsZones) { + this.dnsZones = dnsZones; + } + + public V1alpha2IssuerSpecAcmeSelector matchLabels(Map matchLabels) { + + this.matchLabels = matchLabels; + return this; + } + + public V1alpha2IssuerSpecAcmeSelector putMatchLabelsItem(String key, String matchLabelsItem) { + if (this.matchLabels == null) { + this.matchLabels = new HashMap(); + } + this.matchLabels.put(key, matchLabelsItem); + return this; + } + + /** + * A label selector that is used to refine the set of certificate's that this challenge solver + * will apply to. + * + * @return matchLabels + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A label selector that is used to refine the set of certificate's that this challenge solver will apply to.") + public Map getMatchLabels() { + return matchLabels; + } + + public void setMatchLabels(Map matchLabels) { + this.matchLabels = matchLabels; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeSelector v1alpha2IssuerSpecAcmeSelector = + (V1alpha2IssuerSpecAcmeSelector) o; + return Objects.equals(this.dnsNames, v1alpha2IssuerSpecAcmeSelector.dnsNames) + && Objects.equals(this.dnsZones, v1alpha2IssuerSpecAcmeSelector.dnsZones) + && Objects.equals(this.matchLabels, v1alpha2IssuerSpecAcmeSelector.matchLabels); + } + + @Override + public int hashCode() { + return Objects.hash(dnsNames, dnsZones, matchLabels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeSelector {\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" dnsZones: ").append(toIndentedString(dnsZones)).append("\n"); + sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java new file mode 100644 index 0000000000..64d32fed84 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java @@ -0,0 +1,148 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 + * may be provided. + */ +@ApiModel( + description = + "Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 may be provided.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecAcmeSolvers { + public static final String SERIALIZED_NAME_DNS01 = "dns01"; + + @SerializedName(SERIALIZED_NAME_DNS01) + private V1alpha2IssuerSpecAcmeDns01 dns01; + + public static final String SERIALIZED_NAME_HTTP01 = "http01"; + + @SerializedName(SERIALIZED_NAME_HTTP01) + private V1alpha2IssuerSpecAcmeHttp01 http01; + + public static final String SERIALIZED_NAME_SELECTOR = "selector"; + + @SerializedName(SERIALIZED_NAME_SELECTOR) + private V1alpha2IssuerSpecAcmeSelector selector; + + public V1alpha2IssuerSpecAcmeSolvers dns01(V1alpha2IssuerSpecAcmeDns01 dns01) { + + this.dns01 = dns01; + return this; + } + + /** + * Get dns01 + * + * @return dns01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01 getDns01() { + return dns01; + } + + public void setDns01(V1alpha2IssuerSpecAcmeDns01 dns01) { + this.dns01 = dns01; + } + + public V1alpha2IssuerSpecAcmeSolvers http01(V1alpha2IssuerSpecAcmeHttp01 http01) { + + this.http01 = http01; + return this; + } + + /** + * Get http01 + * + * @return http01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { + return http01; + } + + public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { + this.http01 = http01; + } + + public V1alpha2IssuerSpecAcmeSolvers selector(V1alpha2IssuerSpecAcmeSelector selector) { + + this.selector = selector; + return this; + } + + /** + * Get selector + * + * @return selector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeSelector getSelector() { + return selector; + } + + public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { + this.selector = selector; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecAcmeSolvers v1alpha2IssuerSpecAcmeSolvers = (V1alpha2IssuerSpecAcmeSolvers) o; + return Objects.equals(this.dns01, v1alpha2IssuerSpecAcmeSolvers.dns01) + && Objects.equals(this.http01, v1alpha2IssuerSpecAcmeSolvers.http01) + && Objects.equals(this.selector, v1alpha2IssuerSpecAcmeSolvers.selector); + } + + @Override + public int hashCode() { + return Objects.hash(dns01, http01, selector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecAcmeSolvers {\n"); + sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); + sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); + sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java new file mode 100644 index 0000000000..7b8715720d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java @@ -0,0 +1,138 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * CA configures this issuer to sign certificates using a signing CA keypair stored in a Secret + * resource. This is used to build internal PKIs that are managed by cert-manager. + */ +@ApiModel( + description = + "CA configures this issuer to sign certificates using a signing CA keypair stored in a Secret resource. This is used to build internal PKIs that are managed by cert-manager.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecCa { + public static final String SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS = "crlDistributionPoints"; + + @SerializedName(SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS) + private List crlDistributionPoints = null; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public V1alpha2IssuerSpecCa crlDistributionPoints(List crlDistributionPoints) { + + this.crlDistributionPoints = crlDistributionPoints; + return this; + } + + public V1alpha2IssuerSpecCa addCrlDistributionPointsItem(String crlDistributionPointsItem) { + if (this.crlDistributionPoints == null) { + this.crlDistributionPoints = new ArrayList(); + } + this.crlDistributionPoints.add(crlDistributionPointsItem); + return this; + } + + /** + * The CRL distribution points is an X.509 v3 certificate extension which identifies the location + * of the CRL from which the revocation of this certificate can be checked. If not set, + * certificates will be issued without distribution points set. + * + * @return crlDistributionPoints + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The CRL distribution points is an X.509 v3 certificate extension which identifies the location of the CRL from which the revocation of this certificate can be checked. If not set, certificates will be issued without distribution points set.") + public List getCrlDistributionPoints() { + return crlDistributionPoints; + } + + public void setCrlDistributionPoints(List crlDistributionPoints) { + this.crlDistributionPoints = crlDistributionPoints; + } + + public V1alpha2IssuerSpecCa secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * SecretName is the name of the secret used to sign Certificates issued by this Issuer. + * + * @return secretName + */ + @ApiModelProperty( + required = true, + value = + "SecretName is the name of the secret used to sign Certificates issued by this Issuer.") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecCa v1alpha2IssuerSpecCa = (V1alpha2IssuerSpecCa) o; + return Objects.equals(this.crlDistributionPoints, v1alpha2IssuerSpecCa.crlDistributionPoints) + && Objects.equals(this.secretName, v1alpha2IssuerSpecCa.secretName); + } + + @Override + public int hashCode() { + return Objects.hash(crlDistributionPoints, secretName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecCa {\n"); + sb.append(" crlDistributionPoints: ") + .append(toIndentedString(crlDistributionPoints)) + .append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java new file mode 100644 index 0000000000..ddb5146127 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java @@ -0,0 +1,110 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * SelfSigned configures this issuer to 'self sign' certificates using the private key used + * to create the CertificateRequest object. + */ +@ApiModel( + description = + "SelfSigned configures this issuer to 'self sign' certificates using the private key used to create the CertificateRequest object.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecSelfSigned { + public static final String SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS = "crlDistributionPoints"; + + @SerializedName(SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS) + private List crlDistributionPoints = null; + + public V1alpha2IssuerSpecSelfSigned crlDistributionPoints(List crlDistributionPoints) { + + this.crlDistributionPoints = crlDistributionPoints; + return this; + } + + public V1alpha2IssuerSpecSelfSigned addCrlDistributionPointsItem( + String crlDistributionPointsItem) { + if (this.crlDistributionPoints == null) { + this.crlDistributionPoints = new ArrayList(); + } + this.crlDistributionPoints.add(crlDistributionPointsItem); + return this; + } + + /** + * The CRL distribution points is an X.509 v3 certificate extension which identifies the location + * of the CRL from which the revocation of this certificate can be checked. If not set certificate + * will be issued without CDP. Values are strings. + * + * @return crlDistributionPoints + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The CRL distribution points is an X.509 v3 certificate extension which identifies the location of the CRL from which the revocation of this certificate can be checked. If not set certificate will be issued without CDP. Values are strings.") + public List getCrlDistributionPoints() { + return crlDistributionPoints; + } + + public void setCrlDistributionPoints(List crlDistributionPoints) { + this.crlDistributionPoints = crlDistributionPoints; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecSelfSigned v1alpha2IssuerSpecSelfSigned = (V1alpha2IssuerSpecSelfSigned) o; + return Objects.equals( + this.crlDistributionPoints, v1alpha2IssuerSpecSelfSigned.crlDistributionPoints); + } + + @Override + public int hashCode() { + return Objects.hash(crlDistributionPoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecSelfSigned {\n"); + sb.append(" crlDistributionPoints: ") + .append(toIndentedString(crlDistributionPoints)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java new file mode 100644 index 0000000000..92bdf63502 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java @@ -0,0 +1,183 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import java.util.Objects; + +/** Vault configures this issuer to sign certificates using a HashiCorp Vault PKI backend. */ +@ApiModel( + description = + "Vault configures this issuer to sign certificates using a HashiCorp Vault PKI backend.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVault { + public static final String SERIALIZED_NAME_AUTH = "auth"; + + @SerializedName(SERIALIZED_NAME_AUTH) + private V1alpha2IssuerSpecVaultAuth auth; + + public static final String SERIALIZED_NAME_CA_BUNDLE = "caBundle"; + + @SerializedName(SERIALIZED_NAME_CA_BUNDLE) + private byte[] caBundle; + + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_SERVER = "server"; + + @SerializedName(SERIALIZED_NAME_SERVER) + private String server; + + public V1alpha2IssuerSpecVault auth(V1alpha2IssuerSpecVaultAuth auth) { + + this.auth = auth; + return this; + } + + /** + * Get auth + * + * @return auth + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecVaultAuth getAuth() { + return auth; + } + + public void setAuth(V1alpha2IssuerSpecVaultAuth auth) { + this.auth = auth; + } + + public V1alpha2IssuerSpecVault caBundle(byte[] caBundle) { + + this.caBundle = caBundle; + return this; + } + + /** + * PEM encoded CA bundle used to validate Vault server certificate. Only used if the Server URL is + * using HTTPS protocol. This parameter is ignored for plain HTTP protocol connection. If not set + * the system root certificates are used to validate the TLS connection. + * + * @return caBundle + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "PEM encoded CA bundle used to validate Vault server certificate. Only used if the Server URL is using HTTPS protocol. This parameter is ignored for plain HTTP protocol connection. If not set the system root certificates are used to validate the TLS connection.") + public byte[] getCaBundle() { + return caBundle; + } + + public void setCaBundle(byte[] caBundle) { + this.caBundle = caBundle; + } + + public V1alpha2IssuerSpecVault path(String path) { + + this.path = path; + return this; + } + + /** + * Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g: + * \"my_pki_mount/sign/my-role-name\". + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g: \"my_pki_mount/sign/my-role-name\".") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1alpha2IssuerSpecVault server(String server) { + + this.server = server; + return this; + } + + /** + * Server is the connection address for the Vault server, e.g: + * \"https://vault.example.com:8200\". + * + * @return server + */ + @ApiModelProperty( + required = true, + value = + "Server is the connection address for the Vault server, e.g: \"https://vault.example.com:8200\".") + public String getServer() { + return server; + } + + public void setServer(String server) { + this.server = server; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVault v1alpha2IssuerSpecVault = (V1alpha2IssuerSpecVault) o; + return Objects.equals(this.auth, v1alpha2IssuerSpecVault.auth) + && Arrays.equals(this.caBundle, v1alpha2IssuerSpecVault.caBundle) + && Objects.equals(this.path, v1alpha2IssuerSpecVault.path) + && Objects.equals(this.server, v1alpha2IssuerSpecVault.server); + } + + @Override + public int hashCode() { + return Objects.hash(auth, Arrays.hashCode(caBundle), path, server); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVault {\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" caBundle: ").append(toIndentedString(caBundle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" server: ").append(toIndentedString(server)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java new file mode 100644 index 0000000000..73bbb8c702 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java @@ -0,0 +1,144 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Auth configures how cert-manager authenticates with the Vault server. */ +@ApiModel(description = "Auth configures how cert-manager authenticates with the Vault server.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuth { + public static final String SERIALIZED_NAME_APP_ROLE = "appRole"; + + @SerializedName(SERIALIZED_NAME_APP_ROLE) + private V1alpha2IssuerSpecVaultAuthAppRole appRole; + + public static final String SERIALIZED_NAME_KUBERNETES = "kubernetes"; + + @SerializedName(SERIALIZED_NAME_KUBERNETES) + private V1alpha2IssuerSpecVaultAuthKubernetes kubernetes; + + public static final String SERIALIZED_NAME_TOKEN_SECRET_REF = "tokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef; + + public V1alpha2IssuerSpecVaultAuth appRole(V1alpha2IssuerSpecVaultAuthAppRole appRole) { + + this.appRole = appRole; + return this; + } + + /** + * Get appRole + * + * @return appRole + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVaultAuthAppRole getAppRole() { + return appRole; + } + + public void setAppRole(V1alpha2IssuerSpecVaultAuthAppRole appRole) { + this.appRole = appRole; + } + + public V1alpha2IssuerSpecVaultAuth kubernetes(V1alpha2IssuerSpecVaultAuthKubernetes kubernetes) { + + this.kubernetes = kubernetes; + return this; + } + + /** + * Get kubernetes + * + * @return kubernetes + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVaultAuthKubernetes getKubernetes() { + return kubernetes; + } + + public void setKubernetes(V1alpha2IssuerSpecVaultAuthKubernetes kubernetes) { + this.kubernetes = kubernetes; + } + + public V1alpha2IssuerSpecVaultAuth tokenSecretRef( + V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef) { + + this.tokenSecretRef = tokenSecretRef; + return this; + } + + /** + * Get tokenSecretRef + * + * @return tokenSecretRef + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVaultAuthTokenSecretRef getTokenSecretRef() { + return tokenSecretRef; + } + + public void setTokenSecretRef(V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef) { + this.tokenSecretRef = tokenSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuth v1alpha2IssuerSpecVaultAuth = (V1alpha2IssuerSpecVaultAuth) o; + return Objects.equals(this.appRole, v1alpha2IssuerSpecVaultAuth.appRole) + && Objects.equals(this.kubernetes, v1alpha2IssuerSpecVaultAuth.kubernetes) + && Objects.equals(this.tokenSecretRef, v1alpha2IssuerSpecVaultAuth.tokenSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(appRole, kubernetes, tokenSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuth {\n"); + sb.append(" appRole: ").append(toIndentedString(appRole)).append("\n"); + sb.append(" kubernetes: ").append(toIndentedString(kubernetes)).append("\n"); + sb.append(" tokenSecretRef: ").append(toIndentedString(tokenSecretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java new file mode 100644 index 0000000000..775730ebdd --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java @@ -0,0 +1,154 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * AppRole authenticates with Vault using the App Role auth mechanism, with the role and secret + * stored in a Kubernetes Secret resource. + */ +@ApiModel( + description = + "AppRole authenticates with Vault using the App Role auth mechanism, with the role and secret stored in a Kubernetes Secret resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuthAppRole { + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; + + @SerializedName(SERIALIZED_NAME_ROLE_ID) + private String roleId; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef; + + public V1alpha2IssuerSpecVaultAuthAppRole path(String path) { + + this.path = path; + return this; + } + + /** + * Path where the App Role authentication backend is mounted in Vault, e.g: \"approle\" + * + * @return path + */ + @ApiModelProperty( + required = true, + value = + "Path where the App Role authentication backend is mounted in Vault, e.g: \"approle\"") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public V1alpha2IssuerSpecVaultAuthAppRole roleId(String roleId) { + + this.roleId = roleId; + return this; + } + + /** + * RoleID configured in the App Role authentication backend when setting up the authentication + * backend in Vault. + * + * @return roleId + */ + @ApiModelProperty( + required = true, + value = + "RoleID configured in the App Role authentication backend when setting up the authentication backend in Vault.") + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public V1alpha2IssuerSpecVaultAuthAppRole secretRef( + V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef) { + this.secretRef = secretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuthAppRole v1alpha2IssuerSpecVaultAuthAppRole = + (V1alpha2IssuerSpecVaultAuthAppRole) o; + return Objects.equals(this.path, v1alpha2IssuerSpecVaultAuthAppRole.path) + && Objects.equals(this.roleId, v1alpha2IssuerSpecVaultAuthAppRole.roleId) + && Objects.equals(this.secretRef, v1alpha2IssuerSpecVaultAuthAppRole.secretRef); + } + + @Override + public int hashCode() { + return Objects.hash(path, roleId, secretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuthAppRole {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java new file mode 100644 index 0000000000..3d4d631eec --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Reference to a key in a Secret that contains the App Role secret used to authenticate with Vault. + * The `key` field must be specified and denotes which entry within the Secret resource is + * used as the app role secret. + */ +@ApiModel( + description = + "Reference to a key in a Secret that contains the App Role secret used to authenticate with Vault. The `key` field must be specified and denotes which entry within the Secret resource is used as the app role secret.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuthAppRoleSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuthAppRoleSecretRef v1alpha2IssuerSpecVaultAuthAppRoleSecretRef = + (V1alpha2IssuerSpecVaultAuthAppRoleSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthAppRoleSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthAppRoleSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuthAppRoleSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java new file mode 100644 index 0000000000..bf2531fd8a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java @@ -0,0 +1,157 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Kubernetes authenticates with Vault by passing the ServiceAccount token stored in the named + * Secret resource to the Vault server. + */ +@ApiModel( + description = + "Kubernetes authenticates with Vault by passing the ServiceAccount token stored in the named Secret resource to the Vault server.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuthKubernetes { + public static final String SERIALIZED_NAME_MOUNT_PATH = "mountPath"; + + @SerializedName(SERIALIZED_NAME_MOUNT_PATH) + private String mountPath; + + public static final String SERIALIZED_NAME_ROLE = "role"; + + @SerializedName(SERIALIZED_NAME_ROLE) + private String role; + + public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; + + @SerializedName(SERIALIZED_NAME_SECRET_REF) + private V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef; + + public V1alpha2IssuerSpecVaultAuthKubernetes mountPath(String mountPath) { + + this.mountPath = mountPath; + return this; + } + + /** + * The Vault mountPath here is the mount path to use when authenticating with Vault. For example, + * setting a value to `/v1/auth/foo`, will use the path `/v1/auth/foo/login` + * to authenticate with Vault. If unspecified, the default value \"/v1/auth/kubernetes\" + * will be used. + * + * @return mountPath + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The Vault mountPath here is the mount path to use when authenticating with Vault. For example, setting a value to `/v1/auth/foo`, will use the path `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the default value \"/v1/auth/kubernetes\" will be used.") + public String getMountPath() { + return mountPath; + } + + public void setMountPath(String mountPath) { + this.mountPath = mountPath; + } + + public V1alpha2IssuerSpecVaultAuthKubernetes role(String role) { + + this.role = role; + return this; + } + + /** + * A required field containing the Vault Role to assume. A Role binds a Kubernetes ServiceAccount + * with a set of Vault policies. + * + * @return role + */ + @ApiModelProperty( + required = true, + value = + "A required field containing the Vault Role to assume. A Role binds a Kubernetes ServiceAccount with a set of Vault policies.") + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public V1alpha2IssuerSpecVaultAuthKubernetes secretRef( + V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef) { + + this.secretRef = secretRef; + return this; + } + + /** + * Get secretRef + * + * @return secretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef getSecretRef() { + return secretRef; + } + + public void setSecretRef(V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef) { + this.secretRef = secretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuthKubernetes v1alpha2IssuerSpecVaultAuthKubernetes = + (V1alpha2IssuerSpecVaultAuthKubernetes) o; + return Objects.equals(this.mountPath, v1alpha2IssuerSpecVaultAuthKubernetes.mountPath) + && Objects.equals(this.role, v1alpha2IssuerSpecVaultAuthKubernetes.role) + && Objects.equals(this.secretRef, v1alpha2IssuerSpecVaultAuthKubernetes.secretRef); + } + + @Override + public int hashCode() { + return Objects.hash(mountPath, role, secretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuthKubernetes {\n"); + sb.append(" mountPath: ").append(toIndentedString(mountPath)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java new file mode 100644 index 0000000000..7fb28734f5 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java @@ -0,0 +1,127 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * The required Secret field containing a Kubernetes ServiceAccount JWT used for authenticating with + * Vault. Use of 'ambient credentials' is not supported. + */ +@ApiModel( + description = + "The required Secret field containing a Kubernetes ServiceAccount JWT used for authenticating with Vault. Use of 'ambient credentials' is not supported.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuthKubernetesSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuthKubernetesSecretRef v1alpha2IssuerSpecVaultAuthKubernetesSecretRef = + (V1alpha2IssuerSpecVaultAuthKubernetesSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthKubernetesSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthKubernetesSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuthKubernetesSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java new file mode 100644 index 0000000000..3579150570 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java @@ -0,0 +1,122 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** TokenSecretRef authenticates with Vault by presenting a token. */ +@ApiModel(description = "TokenSecretRef authenticates with Vault by presenting a token.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVaultAuthTokenSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecVaultAuthTokenSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecVaultAuthTokenSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVaultAuthTokenSecretRef v1alpha2IssuerSpecVaultAuthTokenSecretRef = + (V1alpha2IssuerSpecVaultAuthTokenSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthTokenSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthTokenSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVaultAuthTokenSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java new file mode 100644 index 0000000000..b5cc761de2 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Venafi configures this issuer to sign certificates using a Venafi TPP or Venafi Cloud policy + * zone. + */ +@ApiModel( + description = + "Venafi configures this issuer to sign certificates using a Venafi TPP or Venafi Cloud policy zone.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVenafi { + public static final String SERIALIZED_NAME_CLOUD = "cloud"; + + @SerializedName(SERIALIZED_NAME_CLOUD) + private V1alpha2IssuerSpecVenafiCloud cloud; + + public static final String SERIALIZED_NAME_TPP = "tpp"; + + @SerializedName(SERIALIZED_NAME_TPP) + private V1alpha2IssuerSpecVenafiTpp tpp; + + public static final String SERIALIZED_NAME_ZONE = "zone"; + + @SerializedName(SERIALIZED_NAME_ZONE) + private String zone; + + public V1alpha2IssuerSpecVenafi cloud(V1alpha2IssuerSpecVenafiCloud cloud) { + + this.cloud = cloud; + return this; + } + + /** + * Get cloud + * + * @return cloud + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafiCloud getCloud() { + return cloud; + } + + public void setCloud(V1alpha2IssuerSpecVenafiCloud cloud) { + this.cloud = cloud; + } + + public V1alpha2IssuerSpecVenafi tpp(V1alpha2IssuerSpecVenafiTpp tpp) { + + this.tpp = tpp; + return this; + } + + /** + * Get tpp + * + * @return tpp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafiTpp getTpp() { + return tpp; + } + + public void setTpp(V1alpha2IssuerSpecVenafiTpp tpp) { + this.tpp = tpp; + } + + public V1alpha2IssuerSpecVenafi zone(String zone) { + + this.zone = zone; + return this; + } + + /** + * Zone is the Venafi Policy Zone to use for this issuer. All requests made to the Venafi platform + * will be restricted by the named zone policy. This field is required. + * + * @return zone + */ + @ApiModelProperty( + required = true, + value = + "Zone is the Venafi Policy Zone to use for this issuer. All requests made to the Venafi platform will be restricted by the named zone policy. This field is required.") + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVenafi v1alpha2IssuerSpecVenafi = (V1alpha2IssuerSpecVenafi) o; + return Objects.equals(this.cloud, v1alpha2IssuerSpecVenafi.cloud) + && Objects.equals(this.tpp, v1alpha2IssuerSpecVenafi.tpp) + && Objects.equals(this.zone, v1alpha2IssuerSpecVenafi.zone); + } + + @Override + public int hashCode() { + return Objects.hash(cloud, tpp, zone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVenafi {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" tpp: ").append(toIndentedString(tpp)).append("\n"); + sb.append(" zone: ").append(toIndentedString(zone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java new file mode 100644 index 0000000000..5f01d467e3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java @@ -0,0 +1,122 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Cloud specifies the Venafi cloud configuration settings. Only one of TPP or Cloud may be + * specified. + */ +@ApiModel( + description = + "Cloud specifies the Venafi cloud configuration settings. Only one of TPP or Cloud may be specified.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVenafiCloud { + public static final String SERIALIZED_NAME_API_TOKEN_SECRET_REF = "apiTokenSecretRef"; + + @SerializedName(SERIALIZED_NAME_API_TOKEN_SECRET_REF) + private V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public V1alpha2IssuerSpecVenafiCloud apiTokenSecretRef( + V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef) { + + this.apiTokenSecretRef = apiTokenSecretRef; + return this; + } + + /** + * Get apiTokenSecretRef + * + * @return apiTokenSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef getApiTokenSecretRef() { + return apiTokenSecretRef; + } + + public void setApiTokenSecretRef( + V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef) { + this.apiTokenSecretRef = apiTokenSecretRef; + } + + public V1alpha2IssuerSpecVenafiCloud url(String url) { + + this.url = url; + return this; + } + + /** + * URL is the base URL for Venafi Cloud. Defaults to \"https://api.venafi.cloud/v1\". + * + * @return url + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "URL is the base URL for Venafi Cloud. Defaults to \"https://api.venafi.cloud/v1\".") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVenafiCloud v1alpha2IssuerSpecVenafiCloud = (V1alpha2IssuerSpecVenafiCloud) o; + return Objects.equals(this.apiTokenSecretRef, v1alpha2IssuerSpecVenafiCloud.apiTokenSecretRef) + && Objects.equals(this.url, v1alpha2IssuerSpecVenafiCloud.url); + } + + @Override + public int hashCode() { + return Objects.hash(apiTokenSecretRef, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVenafiCloud {\n"); + sb.append(" apiTokenSecretRef: ").append(toIndentedString(apiTokenSecretRef)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java new file mode 100644 index 0000000000..c0fd49eca8 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java @@ -0,0 +1,123 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** APITokenSecretRef is a secret key selector for the Venafi Cloud API token. */ +@ApiModel( + description = "APITokenSecretRef is a secret key selector for the Venafi Cloud API token.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef = + (V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef) o; + return Objects.equals(this.key, v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.key) + && Objects.equals(this.name, v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java new file mode 100644 index 0000000000..e3f57fce6a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java @@ -0,0 +1,157 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import java.util.Objects; + +/** + * TPP specifies Trust Protection Platform configuration settings. Only one of TPP or Cloud may be + * specified. + */ +@ApiModel( + description = + "TPP specifies Trust Protection Platform configuration settings. Only one of TPP or Cloud may be specified.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVenafiTpp { + public static final String SERIALIZED_NAME_CA_BUNDLE = "caBundle"; + + @SerializedName(SERIALIZED_NAME_CA_BUNDLE) + private byte[] caBundle; + + public static final String SERIALIZED_NAME_CREDENTIALS_REF = "credentialsRef"; + + @SerializedName(SERIALIZED_NAME_CREDENTIALS_REF) + private V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public V1alpha2IssuerSpecVenafiTpp caBundle(byte[] caBundle) { + + this.caBundle = caBundle; + return this; + } + + /** + * CABundle is a PEM encoded TLS certificate to use to verify connections to the TPP instance. If + * specified, system roots will not be used and the issuing CA for the TPP instance must be + * verifiable using the provided root. If not specified, the connection will be verified using the + * cert-manager system root certificates. + * + * @return caBundle + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CABundle is a PEM encoded TLS certificate to use to verify connections to the TPP instance. If specified, system roots will not be used and the issuing CA for the TPP instance must be verifiable using the provided root. If not specified, the connection will be verified using the cert-manager system root certificates.") + public byte[] getCaBundle() { + return caBundle; + } + + public void setCaBundle(byte[] caBundle) { + this.caBundle = caBundle; + } + + public V1alpha2IssuerSpecVenafiTpp credentialsRef( + V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef) { + + this.credentialsRef = credentialsRef; + return this; + } + + /** + * Get credentialsRef + * + * @return credentialsRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecVenafiTppCredentialsRef getCredentialsRef() { + return credentialsRef; + } + + public void setCredentialsRef(V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef) { + this.credentialsRef = credentialsRef; + } + + public V1alpha2IssuerSpecVenafiTpp url(String url) { + + this.url = url; + return this; + } + + /** + * URL is the base URL for the vedsdk endpoint of the Venafi TPP instance, for example: + * \"https://tpp.example.com/vedsdk\". + * + * @return url + */ + @ApiModelProperty( + required = true, + value = + "URL is the base URL for the vedsdk endpoint of the Venafi TPP instance, for example: \"https://tpp.example.com/vedsdk\".") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVenafiTpp v1alpha2IssuerSpecVenafiTpp = (V1alpha2IssuerSpecVenafiTpp) o; + return Arrays.equals(this.caBundle, v1alpha2IssuerSpecVenafiTpp.caBundle) + && Objects.equals(this.credentialsRef, v1alpha2IssuerSpecVenafiTpp.credentialsRef) + && Objects.equals(this.url, v1alpha2IssuerSpecVenafiTpp.url); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(caBundle), credentialsRef, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVenafiTpp {\n"); + sb.append(" caBundle: ").append(toIndentedString(caBundle)).append("\n"); + sb.append(" credentialsRef: ").append(toIndentedString(credentialsRef)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java new file mode 100644 index 0000000000..43a20881be --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * CredentialsRef is a reference to a Secret containing the username and password for the TPP + * server. The secret must contain two keys, 'username' and 'password'. + */ +@ApiModel( + description = + "CredentialsRef is a reference to a Secret containing the username and password for the TPP server. The secret must contain two keys, 'username' and 'password'.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerSpecVenafiTppCredentialsRef { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha2IssuerSpecVenafiTppCredentialsRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerSpecVenafiTppCredentialsRef v1alpha2IssuerSpecVenafiTppCredentialsRef = + (V1alpha2IssuerSpecVenafiTppCredentialsRef) o; + return Objects.equals(this.name, v1alpha2IssuerSpecVenafiTppCredentialsRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerSpecVenafiTppCredentialsRef {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java new file mode 100644 index 0000000000..e6e9b08cbb --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Status of the Issuer. This is set and managed automatically. */ +@ApiModel(description = "Status of the Issuer. This is set and managed automatically.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerStatus { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1alpha2IssuerStatusAcme acme; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public V1alpha2IssuerStatus acme(V1alpha2IssuerStatusAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerStatusAcme getAcme() { + return acme; + } + + public void setAcme(V1alpha2IssuerStatusAcme acme) { + this.acme = acme; + } + + public V1alpha2IssuerStatus conditions(List conditions) { + + this.conditions = conditions; + return this; + } + + public V1alpha2IssuerStatus addConditionsItem(V1alpha2IssuerStatusConditions conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of status conditions to indicate the status of a CertificateRequest. Known condition types + * are `Ready`. + * + * @return conditions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready`.") + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerStatus v1alpha2IssuerStatus = (V1alpha2IssuerStatus) o; + return Objects.equals(this.acme, v1alpha2IssuerStatus.acme) + && Objects.equals(this.conditions, v1alpha2IssuerStatus.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(acme, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerStatus {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java new file mode 100644 index 0000000000..f2fa132544 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * ACME specific status options. This field should only be set if the Issuer is configured to use an + * ACME server to issue certificates. + */ +@ApiModel( + description = + "ACME specific status options. This field should only be set if the Issuer is configured to use an ACME server to issue certificates.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerStatusAcme { + public static final String SERIALIZED_NAME_LAST_REGISTERED_EMAIL = "lastRegisteredEmail"; + + @SerializedName(SERIALIZED_NAME_LAST_REGISTERED_EMAIL) + private String lastRegisteredEmail; + + public static final String SERIALIZED_NAME_URI = "uri"; + + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public V1alpha2IssuerStatusAcme lastRegisteredEmail(String lastRegisteredEmail) { + + this.lastRegisteredEmail = lastRegisteredEmail; + return this; + } + + /** + * LastRegisteredEmail is the email associated with the latest registered ACME account, in order + * to track changes made to registered account associated with the Issuer + * + * @return lastRegisteredEmail + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "LastRegisteredEmail is the email associated with the latest registered ACME account, in order to track changes made to registered account associated with the Issuer") + public String getLastRegisteredEmail() { + return lastRegisteredEmail; + } + + public void setLastRegisteredEmail(String lastRegisteredEmail) { + this.lastRegisteredEmail = lastRegisteredEmail; + } + + public V1alpha2IssuerStatusAcme uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * URI is the unique account identifier, which can also be used to retrieve account details from + * the CA + * + * @return uri + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "URI is the unique account identifier, which can also be used to retrieve account details from the CA") + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerStatusAcme v1alpha2IssuerStatusAcme = (V1alpha2IssuerStatusAcme) o; + return Objects.equals(this.lastRegisteredEmail, v1alpha2IssuerStatusAcme.lastRegisteredEmail) + && Objects.equals(this.uri, v1alpha2IssuerStatusAcme.uri); + } + + @Override + public int hashCode() { + return Objects.hash(lastRegisteredEmail, uri); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerStatusAcme {\n"); + sb.append(" lastRegisteredEmail: ") + .append(toIndentedString(lastRegisteredEmail)) + .append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java new file mode 100644 index 0000000000..b99af8b7ab --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java @@ -0,0 +1,261 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** IssuerCondition contains condition information for an Issuer. */ +@ApiModel(description = "IssuerCondition contains condition information for an Issuer.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2IssuerStatusConditions { + public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; + + @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) + private OffsetDateTime lastTransitionTime; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** Status of the condition, one of ('True', 'False', 'Unknown'). */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + TRUE("True"), + + FALSE("False"), + + UNKNOWN("Unknown"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public V1alpha2IssuerStatusConditions lastTransitionTime(OffsetDateTime lastTransitionTime) { + + this.lastTransitionTime = lastTransitionTime; + return this; + } + + /** + * LastTransitionTime is the timestamp corresponding to the last status change of this condition. + * + * @return lastTransitionTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") + public OffsetDateTime getLastTransitionTime() { + return lastTransitionTime; + } + + public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { + this.lastTransitionTime = lastTransitionTime; + } + + public V1alpha2IssuerStatusConditions message(String message) { + + this.message = message; + return this; + } + + /** + * Message is a human readable description of the details of the last transition, complementing + * reason. + * + * @return message + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Message is a human readable description of the details of the last transition, complementing reason.") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public V1alpha2IssuerStatusConditions reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason is a brief machine readable explanation for the condition's last transition. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Reason is a brief machine readable explanation for the condition's last transition.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1alpha2IssuerStatusConditions status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the condition, one of ('True', 'False', 'Unknown'). + * + * @return status + */ + @ApiModelProperty( + required = true, + value = "Status of the condition, one of ('True', 'False', 'Unknown').") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public V1alpha2IssuerStatusConditions type(String type) { + + this.type = type; + return this; + } + + /** + * Type of the condition, known values are ('Ready'). + * + * @return type + */ + @ApiModelProperty(required = true, value = "Type of the condition, known values are ('Ready').") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2IssuerStatusConditions v1alpha2IssuerStatusConditions = + (V1alpha2IssuerStatusConditions) o; + return Objects.equals( + this.lastTransitionTime, v1alpha2IssuerStatusConditions.lastTransitionTime) + && Objects.equals(this.message, v1alpha2IssuerStatusConditions.message) + && Objects.equals(this.reason, v1alpha2IssuerStatusConditions.reason) + && Objects.equals(this.status, v1alpha2IssuerStatusConditions.status) + && Objects.equals(this.type, v1alpha2IssuerStatusConditions.type); + } + + @Override + public int hashCode() { + return Objects.hash(lastTransitionTime, message, reason, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2IssuerStatusConditions {\n"); + sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java new file mode 100644 index 0000000000..326e3c2cac --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java @@ -0,0 +1,209 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Order is a type to represent an Order with an ACME server */ +@ApiModel(description = "Order is a type to represent an Order with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2Order implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3OrderSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1OrderStatus status; + + public V1alpha2Order apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2Order kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2Order metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha2Order spec(V1alpha3OrderSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3OrderSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3OrderSpec spec) { + this.spec = spec; + } + + public V1alpha2Order status(V1beta1OrderStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1OrderStatus getStatus() { + return status; + } + + public void setStatus(V1beta1OrderStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2Order v1alpha2Order = (V1alpha2Order) o; + return Objects.equals(this.apiVersion, v1alpha2Order.apiVersion) + && Objects.equals(this.kind, v1alpha2Order.kind) + && Objects.equals(this.metadata, v1alpha2Order.metadata) + && Objects.equals(this.spec, v1alpha2Order.spec) + && Objects.equals(this.status, v1alpha2Order.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2Order {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java new file mode 100644 index 0000000000..ff8932cd59 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** OrderList is a list of Order */ +@ApiModel(description = "OrderList is a list of Order") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha2OrderList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha2OrderList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha2OrderList items(List items) { + + this.items = items; + return this; + } + + public V1alpha2OrderList addItemsItem(V1alpha2Order itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of orders. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha2OrderList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha2OrderList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha2OrderList v1alpha2OrderList = (V1alpha2OrderList) o; + return Objects.equals(this.apiVersion, v1alpha2OrderList.apiVersion) + && Objects.equals(this.items, v1alpha2OrderList.items) + && Objects.equals(this.kind, v1alpha2OrderList.kind) + && Objects.equals(this.metadata, v1alpha2OrderList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha2OrderList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java new file mode 100644 index 0000000000..93bbfb93e8 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A Certificate resource should be created to ensure an up to date and signed x509 certificate is + * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored + * certificate will be renewed before it expires (as configured by `spec.renewBefore`). + */ +@ApiModel( + description = + "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3Certificate implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3CertificateSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateStatus status; + + public V1alpha3Certificate apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3Certificate kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3Certificate metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3Certificate spec(V1alpha3CertificateSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3CertificateSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3CertificateSpec spec) { + this.spec = spec; + } + + public V1alpha3Certificate status(V1beta1CertificateStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3Certificate v1alpha3Certificate = (V1alpha3Certificate) o; + return Objects.equals(this.apiVersion, v1alpha3Certificate.apiVersion) + && Objects.equals(this.kind, v1alpha3Certificate.kind) + && Objects.equals(this.metadata, v1alpha3Certificate.metadata) + && Objects.equals(this.spec, v1alpha3Certificate.spec) + && Objects.equals(this.status, v1alpha3Certificate.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3Certificate {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java new file mode 100644 index 0000000000..bfebc17469 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateList is a list of Certificate */ +@ApiModel(description = "CertificateList is a list of Certificate") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3CertificateList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3CertificateList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3CertificateList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3CertificateList addItemsItem(V1alpha3Certificate itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificates. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3CertificateList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3CertificateList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3CertificateList v1alpha3CertificateList = (V1alpha3CertificateList) o; + return Objects.equals(this.apiVersion, v1alpha3CertificateList.apiVersion) + && Objects.equals(this.items, v1alpha3CertificateList.items) + && Objects.equals(this.kind, v1alpha3CertificateList.kind) + && Objects.equals(this.metadata, v1alpha3CertificateList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3CertificateList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java new file mode 100644 index 0000000000..7581b0aadd --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java @@ -0,0 +1,218 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A CertificateRequest is used to request a signed certificate from one of the configured issuers. + * All fields within the CertificateRequest's `spec` are immutable after creation. A + * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. + * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in + * time request for a certificate and cannot be re-used. + */ +@ApiModel( + description = + "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3CertificateRequest implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2CertificateRequestSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateRequestStatus status; + + public V1alpha3CertificateRequest apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3CertificateRequest kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3CertificateRequest metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3CertificateRequest spec(V1alpha2CertificateRequestSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateRequestSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2CertificateRequestSpec spec) { + this.spec = spec; + } + + public V1alpha3CertificateRequest status(V1beta1CertificateRequestStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateRequestStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateRequestStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3CertificateRequest v1alpha3CertificateRequest = (V1alpha3CertificateRequest) o; + return Objects.equals(this.apiVersion, v1alpha3CertificateRequest.apiVersion) + && Objects.equals(this.kind, v1alpha3CertificateRequest.kind) + && Objects.equals(this.metadata, v1alpha3CertificateRequest.metadata) + && Objects.equals(this.spec, v1alpha3CertificateRequest.spec) + && Objects.equals(this.status, v1alpha3CertificateRequest.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3CertificateRequest {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java new file mode 100644 index 0000000000..964c957c4e --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java @@ -0,0 +1,194 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateRequestList is a list of CertificateRequest */ +@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3CertificateRequestList + implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3CertificateRequestList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3CertificateRequestList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3CertificateRequestList addItemsItem(V1alpha3CertificateRequest itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificaterequests. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3CertificateRequestList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3CertificateRequestList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3CertificateRequestList v1alpha3CertificateRequestList = + (V1alpha3CertificateRequestList) o; + return Objects.equals(this.apiVersion, v1alpha3CertificateRequestList.apiVersion) + && Objects.equals(this.items, v1alpha3CertificateRequestList.items) + && Objects.equals(this.kind, v1alpha3CertificateRequestList.kind) + && Objects.equals(this.metadata, v1alpha3CertificateRequestList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3CertificateRequestList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java new file mode 100644 index 0000000000..4aa5981b16 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java @@ -0,0 +1,848 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Desired state of the Certificate resource. */ +@ApiModel(description = "Desired state of the Certificate resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3CertificateSpec { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = null; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; + + @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) + private List emailSANs = null; + + public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; + + @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) + private List ipAddresses = null; + + public static final String SERIALIZED_NAME_IS_C_A = "isCA"; + + @SerializedName(SERIALIZED_NAME_IS_C_A) + private Boolean isCA; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1CertificateSpecIssuerRef issuerRef; + + /** + * KeyAlgorithm is the private key algorithm of the corresponding private key for this + * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 + * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + */ + @JsonAdapter(KeyAlgorithmEnum.Adapter.class) + public enum KeyAlgorithmEnum { + RSA("rsa"), + + ECDSA("ecdsa"); + + private String value; + + KeyAlgorithmEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyAlgorithmEnum fromValue(String value) { + for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyAlgorithmEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; + + @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) + private KeyAlgorithmEnum keyAlgorithm; + + /** + * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private + * key to be encoded in. If provided, allowed values are \"pkcs1\" and + * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not + * specified, then PKCS#1 will be used by default. + */ + @JsonAdapter(KeyEncodingEnum.Adapter.class) + public enum KeyEncodingEnum { + PKCS1("pkcs1"), + + PKCS8("pkcs8"); + + private String value; + + KeyEncodingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KeyEncodingEnum fromValue(String value) { + for (KeyEncodingEnum b : KeyEncodingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KeyEncodingEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KeyEncodingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KeyEncodingEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KEY_ENCODING = "keyEncoding"; + + @SerializedName(SERIALIZED_NAME_KEY_ENCODING) + private KeyEncodingEnum keyEncoding; + + public static final String SERIALIZED_NAME_KEY_SIZE = "keySize"; + + @SerializedName(SERIALIZED_NAME_KEY_SIZE) + private Integer keySize; + + public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; + + @SerializedName(SERIALIZED_NAME_KEYSTORES) + private V1beta1CertificateSpecKeystores keystores; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private V1alpha2CertificateSpecPrivateKey privateKey; + + public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; + + @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) + private String renewBefore; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + + @SerializedName(SERIALIZED_NAME_SUBJECT) + private V1beta1CertificateSpecSubject subject; + + public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; + + @SerializedName(SERIALIZED_NAME_URI_S_A_NS) + private List uriSANs = null; + + /** + * KeyUsage specifies valid usage contexts for keys. See: + * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: + * \"signing\", \"digital signature\", \"content commitment\", + * \"key encipherment\", \"key agreement\", \"data encipherment\", + * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher + * only\", \"any\", \"server auth\", \"client auth\", + * \"code signing\", \"email protection\", \"s/mime\", \"ipsec + * end system\", \"ipsec tunnel\", \"ipsec user\", + * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", + * \"netscape sgc\" + */ + @JsonAdapter(UsagesEnum.Adapter.class) + public enum UsagesEnum { + SIGNING("signing"), + + DIGITAL_SIGNATURE("digital signature"), + + CONTENT_COMMITMENT("content commitment"), + + KEY_ENCIPHERMENT("key encipherment"), + + KEY_AGREEMENT("key agreement"), + + DATA_ENCIPHERMENT("data encipherment"), + + CERT_SIGN("cert sign"), + + CRL_SIGN("crl sign"), + + ENCIPHER_ONLY("encipher only"), + + DECIPHER_ONLY("decipher only"), + + ANY("any"), + + SERVER_AUTH("server auth"), + + CLIENT_AUTH("client auth"), + + CODE_SIGNING("code signing"), + + EMAIL_PROTECTION("email protection"), + + S_MIME("s/mime"), + + IPSEC_END_SYSTEM("ipsec end system"), + + IPSEC_TUNNEL("ipsec tunnel"), + + IPSEC_USER("ipsec user"), + + TIMESTAMPING("timestamping"), + + OCSP_SIGNING("ocsp signing"), + + MICROSOFT_SGC("microsoft sgc"), + + NETSCAPE_SGC("netscape sgc"); + + private String value; + + UsagesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsagesEnum fromValue(String value) { + for (UsagesEnum b : UsagesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsagesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsagesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_USAGES = "usages"; + + @SerializedName(SERIALIZED_NAME_USAGES) + private List usages = null; + + public V1alpha3CertificateSpec commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * CommonName is a common name to be used on the Certificate. The CommonName should have a length + * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS + * clients when any subject alt name is set. This is x509 behaviour: + * https://tools.ietf.org/html/rfc6125#section-6.4.4 + * + * @return commonName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public V1alpha3CertificateSpec dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1alpha3CertificateSpec addDnsNamesItem(String dnsNamesItem) { + if (this.dnsNames == null) { + this.dnsNames = new ArrayList(); + } + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + * + * @return dnsNames + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1alpha3CertificateSpec duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be + * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater + * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of + * the way through the certificate's duration. + * + * @return duration + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public V1alpha3CertificateSpec emailSANs(List emailSANs) { + + this.emailSANs = emailSANs; + return this; + } + + public V1alpha3CertificateSpec addEmailSANsItem(String emailSANsItem) { + if (this.emailSANs == null) { + this.emailSANs = new ArrayList(); + } + this.emailSANs.add(emailSANsItem); + return this; + } + + /** + * EmailSANs is a list of email subjectAltNames to be set on the Certificate. + * + * @return emailSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") + public List getEmailSANs() { + return emailSANs; + } + + public void setEmailSANs(List emailSANs) { + this.emailSANs = emailSANs; + } + + public V1alpha3CertificateSpec ipAddresses(List ipAddresses) { + + this.ipAddresses = ipAddresses; + return this; + } + + public V1alpha3CertificateSpec addIpAddressesItem(String ipAddressesItem) { + if (this.ipAddresses == null) { + this.ipAddresses = new ArrayList(); + } + this.ipAddresses.add(ipAddressesItem); + return this; + } + + /** + * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + * + * @return ipAddresses + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") + public List getIpAddresses() { + return ipAddresses; + } + + public void setIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + } + + public V1alpha3CertificateSpec isCA(Boolean isCA) { + + this.isCA = isCA; + return this; + } + + /** + * IsCA will mark this Certificate as valid for certificate signing. This will automatically add + * the `cert sign` usage to the list of `usages`. + * + * @return isCA + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") + public Boolean getIsCA() { + return isCA; + } + + public void setIsCA(Boolean isCA) { + this.isCA = isCA; + } + + public V1alpha3CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1alpha3CertificateSpec keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + + this.keyAlgorithm = keyAlgorithm; + return this; + } + + /** + * KeyAlgorithm is the private key algorithm of the corresponding private key for this + * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 + * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + * + * @return keyAlgorithm + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") + public KeyAlgorithmEnum getKeyAlgorithm() { + return keyAlgorithm; + } + + public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + } + + public V1alpha3CertificateSpec keyEncoding(KeyEncodingEnum keyEncoding) { + + this.keyEncoding = keyEncoding; + return this; + } + + /** + * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private + * key to be encoded in. If provided, allowed values are \"pkcs1\" and + * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not + * specified, then PKCS#1 will be used by default. + * + * @return keyEncoding + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not specified, then PKCS#1 will be used by default.") + public KeyEncodingEnum getKeyEncoding() { + return keyEncoding; + } + + public void setKeyEncoding(KeyEncodingEnum keyEncoding) { + this.keyEncoding = keyEncoding; + } + + public V1alpha3CertificateSpec keySize(Integer keySize) { + + this.keySize = keySize; + return this; + } + + /** + * KeySize is the key bit size of the corresponding private key for this certificate. If + * `keyAlgorithm` is set to `RSA`, valid values are `2048`, + * `4096` or `8192`, and will default to `2048` if not specified. If + * `keyAlgorithm` is set to `ECDSA`, valid values are `256`, + * `384` or `521`, and will default to `256` if not specified. No + * other values are allowed. minimum: 0 maximum: 8192 + * + * @return keySize + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "KeySize is the key bit size of the corresponding private key for this certificate. If `keyAlgorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `keyAlgorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") + public Integer getKeySize() { + return keySize; + } + + public void setKeySize(Integer keySize) { + this.keySize = keySize; + } + + public V1alpha3CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { + + this.keystores = keystores; + return this; + } + + /** + * Get keystores + * + * @return keystores + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecKeystores getKeystores() { + return keystores; + } + + public void setKeystores(V1beta1CertificateSpecKeystores keystores) { + this.keystores = keystores; + } + + public V1alpha3CertificateSpec privateKey(V1alpha2CertificateSpecPrivateKey privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * + * @return privateKey + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2CertificateSpecPrivateKey getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(V1alpha2CertificateSpecPrivateKey privateKey) { + this.privateKey = privateKey; + } + + public V1alpha3CertificateSpec renewBefore(String renewBefore) { + + this.renewBefore = renewBefore; + return this; + } + + /** + * The amount of time before the currently issued certificate's `notAfter` time that + * cert-manager will begin to attempt to renew the certificate. If this value is greater than the + * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed + * 2/3rds of the way through the certificate's duration. + * + * @return renewBefore + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getRenewBefore() { + return renewBefore; + } + + public void setRenewBefore(String renewBefore) { + this.renewBefore = renewBefore; + } + + public V1alpha3CertificateSpec secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * SecretName is the name of the secret resource that will be automatically created and managed by + * this Certificate resource. It will be populated with a private key and certificate, signed by + * the denoted issuer. + * + * @return secretName + */ + @ApiModelProperty( + required = true, + value = + "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + public V1alpha3CertificateSpec subject(V1beta1CertificateSpecSubject subject) { + + this.subject = subject; + return this; + } + + /** + * Get subject + * + * @return subject + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecSubject getSubject() { + return subject; + } + + public void setSubject(V1beta1CertificateSpecSubject subject) { + this.subject = subject; + } + + public V1alpha3CertificateSpec uriSANs(List uriSANs) { + + this.uriSANs = uriSANs; + return this; + } + + public V1alpha3CertificateSpec addUriSANsItem(String uriSANsItem) { + if (this.uriSANs == null) { + this.uriSANs = new ArrayList(); + } + this.uriSANs.add(uriSANsItem); + return this; + } + + /** + * URISANs is a list of URI subjectAltNames to be set on the Certificate. + * + * @return uriSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") + public List getUriSANs() { + return uriSANs; + } + + public void setUriSANs(List uriSANs) { + this.uriSANs = uriSANs; + } + + public V1alpha3CertificateSpec usages(List usages) { + + this.usages = usages; + return this; + } + + public V1alpha3CertificateSpec addUsagesItem(UsagesEnum usagesItem) { + if (this.usages == null) { + this.usages = new ArrayList(); + } + this.usages.add(usagesItem); + return this; + } + + /** + * Usages is the set of x509 usages that are requested for the certificate. Defaults to + * `digital signature` and `key encipherment` if not specified. + * + * @return usages + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3CertificateSpec v1alpha3CertificateSpec = (V1alpha3CertificateSpec) o; + return Objects.equals(this.commonName, v1alpha3CertificateSpec.commonName) + && Objects.equals(this.dnsNames, v1alpha3CertificateSpec.dnsNames) + && Objects.equals(this.duration, v1alpha3CertificateSpec.duration) + && Objects.equals(this.emailSANs, v1alpha3CertificateSpec.emailSANs) + && Objects.equals(this.ipAddresses, v1alpha3CertificateSpec.ipAddresses) + && Objects.equals(this.isCA, v1alpha3CertificateSpec.isCA) + && Objects.equals(this.issuerRef, v1alpha3CertificateSpec.issuerRef) + && Objects.equals(this.keyAlgorithm, v1alpha3CertificateSpec.keyAlgorithm) + && Objects.equals(this.keyEncoding, v1alpha3CertificateSpec.keyEncoding) + && Objects.equals(this.keySize, v1alpha3CertificateSpec.keySize) + && Objects.equals(this.keystores, v1alpha3CertificateSpec.keystores) + && Objects.equals(this.privateKey, v1alpha3CertificateSpec.privateKey) + && Objects.equals(this.renewBefore, v1alpha3CertificateSpec.renewBefore) + && Objects.equals(this.secretName, v1alpha3CertificateSpec.secretName) + && Objects.equals(this.subject, v1alpha3CertificateSpec.subject) + && Objects.equals(this.uriSANs, v1alpha3CertificateSpec.uriSANs) + && Objects.equals(this.usages, v1alpha3CertificateSpec.usages); + } + + @Override + public int hashCode() { + return Objects.hash( + commonName, + dnsNames, + duration, + emailSANs, + ipAddresses, + isCA, + issuerRef, + keyAlgorithm, + keyEncoding, + keySize, + keystores, + privateKey, + renewBefore, + secretName, + subject, + uriSANs, + usages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3CertificateSpec {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); + sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); + sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); + sb.append(" keyEncoding: ").append(toIndentedString(keyEncoding)).append("\n"); + sb.append(" keySize: ").append(toIndentedString(keySize)).append("\n"); + sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); + sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java new file mode 100644 index 0000000000..65748df16a --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java @@ -0,0 +1,209 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Challenge is a type to represent a Challenge request with an ACME server */ +@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3Challenge implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3ChallengeSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha3ChallengeStatus status; + + public V1alpha3Challenge apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3Challenge kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3Challenge metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3Challenge spec(V1alpha3ChallengeSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ChallengeSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3ChallengeSpec spec) { + this.spec = spec; + } + + public V1alpha3Challenge status(V1alpha3ChallengeStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ChallengeStatus getStatus() { + return status; + } + + public void setStatus(V1alpha3ChallengeStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3Challenge v1alpha3Challenge = (V1alpha3Challenge) o; + return Objects.equals(this.apiVersion, v1alpha3Challenge.apiVersion) + && Objects.equals(this.kind, v1alpha3Challenge.kind) + && Objects.equals(this.metadata, v1alpha3Challenge.metadata) + && Objects.equals(this.spec, v1alpha3Challenge.spec) + && Objects.equals(this.status, v1alpha3Challenge.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3Challenge {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java new file mode 100644 index 0000000000..3f0c89c6ac --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ChallengeList is a list of Challenge */ +@ApiModel(description = "ChallengeList is a list of Challenge") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ChallengeList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3ChallengeList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3ChallengeList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3ChallengeList addItemsItem(V1alpha3Challenge itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of challenges. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3ChallengeList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3ChallengeList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ChallengeList v1alpha3ChallengeList = (V1alpha3ChallengeList) o; + return Objects.equals(this.apiVersion, v1alpha3ChallengeList.apiVersion) + && Objects.equals(this.items, v1alpha3ChallengeList.items) + && Objects.equals(this.kind, v1alpha3ChallengeList.kind) + && Objects.equals(this.metadata, v1alpha3ChallengeList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ChallengeList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java new file mode 100644 index 0000000000..dc29da36ce --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java @@ -0,0 +1,385 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** V1alpha3ChallengeSpec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ChallengeSpec { + public static final String SERIALIZED_NAME_AUTHZ_U_R_L = "authzURL"; + + @SerializedName(SERIALIZED_NAME_AUTHZ_U_R_L) + private String authzURL; + + public static final String SERIALIZED_NAME_DNS_NAME = "dnsName"; + + @SerializedName(SERIALIZED_NAME_DNS_NAME) + private String dnsName; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1alpha3ChallengeSpecIssuerRef issuerRef; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_SOLVER = "solver"; + + @SerializedName(SERIALIZED_NAME_SOLVER) + private V1alpha3ChallengeSpecSolver solver; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + /** + * Type is the type of ACME challenge this resource represents. One of \"http-01\" or + * \"dns-01\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + HTTP_01("http-01"), + + DNS_01("dns-01"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; + + @SerializedName(SERIALIZED_NAME_WILDCARD) + private Boolean wildcard; + + public V1alpha3ChallengeSpec authzURL(String authzURL) { + + this.authzURL = authzURL; + return this; + } + + /** + * AuthzURL is the URL to the ACME Authorization resource that this challenge is a part of. + * + * @return authzURL + */ + @ApiModelProperty( + required = true, + value = + "AuthzURL is the URL to the ACME Authorization resource that this challenge is a part of.") + public String getAuthzURL() { + return authzURL; + } + + public void setAuthzURL(String authzURL) { + this.authzURL = authzURL; + } + + public V1alpha3ChallengeSpec dnsName(String dnsName) { + + this.dnsName = dnsName; + return this; + } + + /** + * DNSName is the identifier that this challenge is for, e.g. example.com. If the requested + * DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for + * `*.example.com`, it must be `example.com`. + * + * @return dnsName + */ + @ApiModelProperty( + required = true, + value = + "DNSName is the identifier that this challenge is for, e.g. example.com. If the requested DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for `*.example.com`, it must be `example.com`.") + public String getDnsName() { + return dnsName; + } + + public void setDnsName(String dnsName) { + this.dnsName = dnsName; + } + + public V1alpha3ChallengeSpec issuerRef(V1alpha3ChallengeSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha3ChallengeSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1alpha3ChallengeSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1alpha3ChallengeSpec key(String key) { + + this.key = key; + return this; + } + + /** + * Key is the ACME challenge key for this challenge For HTTP01 challenges, this is the value that + * must be responded with to complete the HTTP01 challenge in the format: `<private key + * JWK thumbprint>.<key from acme server for challenge>`. For DNS01 challenges, this + * is the base64 encoded SHA256 sum of the `<private key JWK thumbprint>.<key from + * acme server for challenge>` text that must be set as the TXT record content. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = + "Key is the ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be responded with to complete the HTTP01 challenge in the format: `.`. For DNS01 challenges, this is the base64 encoded SHA256 sum of the `.` text that must be set as the TXT record content.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1alpha3ChallengeSpec solver(V1alpha3ChallengeSpecSolver solver) { + + this.solver = solver; + return this; + } + + /** + * Get solver + * + * @return solver + */ + @ApiModelProperty(required = true, value = "") + public V1alpha3ChallengeSpecSolver getSolver() { + return solver; + } + + public void setSolver(V1alpha3ChallengeSpecSolver solver) { + this.solver = solver; + } + + public V1alpha3ChallengeSpec token(String token) { + + this.token = token; + return this; + } + + /** + * Token is the ACME challenge token for this challenge. This is the raw value returned from the + * ACME server. + * + * @return token + */ + @ApiModelProperty( + required = true, + value = + "Token is the ACME challenge token for this challenge. This is the raw value returned from the ACME server.") + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public V1alpha3ChallengeSpec type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type is the type of ACME challenge this resource represents. One of \"http-01\" or + * \"dns-01\". + * + * @return type + */ + @ApiModelProperty( + required = true, + value = + "Type is the type of ACME challenge this resource represents. One of \"http-01\" or \"dns-01\".") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public V1alpha3ChallengeSpec url(String url) { + + this.url = url; + return this; + } + + /** + * URL is the URL of the ACME Challenge resource for this challenge. This can be used to lookup + * details about the status of this challenge. + * + * @return url + */ + @ApiModelProperty( + required = true, + value = + "URL is the URL of the ACME Challenge resource for this challenge. This can be used to lookup details about the status of this challenge.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public V1alpha3ChallengeSpec wildcard(Boolean wildcard) { + + this.wildcard = wildcard; + return this; + } + + /** + * Wildcard will be true if this challenge is for a wildcard identifier, for example + * '*.example.com'. + * + * @return wildcard + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Wildcard will be true if this challenge is for a wildcard identifier, for example '*.example.com'.") + public Boolean getWildcard() { + return wildcard; + } + + public void setWildcard(Boolean wildcard) { + this.wildcard = wildcard; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ChallengeSpec v1alpha3ChallengeSpec = (V1alpha3ChallengeSpec) o; + return Objects.equals(this.authzURL, v1alpha3ChallengeSpec.authzURL) + && Objects.equals(this.dnsName, v1alpha3ChallengeSpec.dnsName) + && Objects.equals(this.issuerRef, v1alpha3ChallengeSpec.issuerRef) + && Objects.equals(this.key, v1alpha3ChallengeSpec.key) + && Objects.equals(this.solver, v1alpha3ChallengeSpec.solver) + && Objects.equals(this.token, v1alpha3ChallengeSpec.token) + && Objects.equals(this.type, v1alpha3ChallengeSpec.type) + && Objects.equals(this.url, v1alpha3ChallengeSpec.url) + && Objects.equals(this.wildcard, v1alpha3ChallengeSpec.wildcard); + } + + @Override + public int hashCode() { + return Objects.hash(authzURL, dnsName, issuerRef, key, solver, token, type, url, wildcard); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ChallengeSpec {\n"); + sb.append(" authzURL: ").append(toIndentedString(authzURL)).append("\n"); + sb.append(" dnsName: ").append(toIndentedString(dnsName)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" solver: ").append(toIndentedString(solver)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java new file mode 100644 index 0000000000..6fa1ce69b2 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java @@ -0,0 +1,149 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * IssuerRef references a properly configured ACME-type Issuer which should be used to create this + * Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an + * 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed. + */ +@ApiModel( + description = + "IssuerRef references a properly configured ACME-type Issuer which should be used to create this Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ChallengeSpecIssuerRef { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1alpha3ChallengeSpecIssuerRef group(String group) { + + this.group = group; + return this; + } + + /** + * Group of the resource being referred to. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group of the resource being referred to.") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1alpha3ChallengeSpecIssuerRef kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind of the resource being referred to. + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind of the resource being referred to.") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3ChallengeSpecIssuerRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of the resource being referred to.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ChallengeSpecIssuerRef v1alpha3ChallengeSpecIssuerRef = + (V1alpha3ChallengeSpecIssuerRef) o; + return Objects.equals(this.group, v1alpha3ChallengeSpecIssuerRef.group) + && Objects.equals(this.kind, v1alpha3ChallengeSpecIssuerRef.kind) + && Objects.equals(this.name, v1alpha3ChallengeSpecIssuerRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(group, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ChallengeSpecIssuerRef {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java new file mode 100644 index 0000000000..1a132e09c3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java @@ -0,0 +1,148 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Solver contains the domain solving configuration that should be used to solve this challenge + * resource. + */ +@ApiModel( + description = + "Solver contains the domain solving configuration that should be used to solve this challenge resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ChallengeSpecSolver { + public static final String SERIALIZED_NAME_DNS01 = "dns01"; + + @SerializedName(SERIALIZED_NAME_DNS01) + private V1alpha2IssuerSpecAcmeDns01 dns01; + + public static final String SERIALIZED_NAME_HTTP01 = "http01"; + + @SerializedName(SERIALIZED_NAME_HTTP01) + private V1alpha2IssuerSpecAcmeHttp01 http01; + + public static final String SERIALIZED_NAME_SELECTOR = "selector"; + + @SerializedName(SERIALIZED_NAME_SELECTOR) + private V1alpha2IssuerSpecAcmeSelector selector; + + public V1alpha3ChallengeSpecSolver dns01(V1alpha2IssuerSpecAcmeDns01 dns01) { + + this.dns01 = dns01; + return this; + } + + /** + * Get dns01 + * + * @return dns01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01 getDns01() { + return dns01; + } + + public void setDns01(V1alpha2IssuerSpecAcmeDns01 dns01) { + this.dns01 = dns01; + } + + public V1alpha3ChallengeSpecSolver http01(V1alpha2IssuerSpecAcmeHttp01 http01) { + + this.http01 = http01; + return this; + } + + /** + * Get http01 + * + * @return http01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { + return http01; + } + + public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { + this.http01 = http01; + } + + public V1alpha3ChallengeSpecSolver selector(V1alpha2IssuerSpecAcmeSelector selector) { + + this.selector = selector; + return this; + } + + /** + * Get selector + * + * @return selector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeSelector getSelector() { + return selector; + } + + public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { + this.selector = selector; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ChallengeSpecSolver v1alpha3ChallengeSpecSolver = (V1alpha3ChallengeSpecSolver) o; + return Objects.equals(this.dns01, v1alpha3ChallengeSpecSolver.dns01) + && Objects.equals(this.http01, v1alpha3ChallengeSpecSolver.http01) + && Objects.equals(this.selector, v1alpha3ChallengeSpecSolver.selector); + } + + @Override + public int hashCode() { + return Objects.hash(dns01, http01, selector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ChallengeSpecSolver {\n"); + sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); + sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); + sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java new file mode 100644 index 0000000000..a797c12c5e --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java @@ -0,0 +1,248 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** V1alpha3ChallengeStatus */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ChallengeStatus { + public static final String SERIALIZED_NAME_PRESENTED = "presented"; + + @SerializedName(SERIALIZED_NAME_PRESENTED) + private Boolean presented; + + public static final String SERIALIZED_NAME_PROCESSING = "processing"; + + @SerializedName(SERIALIZED_NAME_PROCESSING) + private Boolean processing; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** + * State contains the current 'state' of the challenge. If not set, the state of the + * challenge is unknown. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + VALID("valid"), + + READY("ready"), + + PENDING("pending"), + + PROCESSING("processing"), + + INVALID("invalid"), + + EXPIRED("expired"), + + ERRORED("errored"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public V1alpha3ChallengeStatus presented(Boolean presented) { + + this.presented = presented; + return this; + } + + /** + * Presented will be set to true if the challenge values for this challenge are currently + * 'presented'. This *does not* imply the self check is passing. Only that the values have + * been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has + * been presented, or the HTTP01 configuration has been configured). + * + * @return presented + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Presented will be set to true if the challenge values for this challenge are currently 'presented'. This *does not* imply the self check is passing. Only that the values have been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has been presented, or the HTTP01 configuration has been configured).") + public Boolean getPresented() { + return presented; + } + + public void setPresented(Boolean presented) { + this.presented = presented; + } + + public V1alpha3ChallengeStatus processing(Boolean processing) { + + this.processing = processing; + return this; + } + + /** + * Processing is used to denote whether this challenge should be processed or not. This field will + * only be set to true by the 'scheduling' component. It will only be set to false by the + * 'challenges' controller, after the challenge has reached a final state or timed out. If + * this field is set to false, the challenge controller will not take any more action. + * + * @return processing + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Processing is used to denote whether this challenge should be processed or not. This field will only be set to true by the 'scheduling' component. It will only be set to false by the 'challenges' controller, after the challenge has reached a final state or timed out. If this field is set to false, the challenge controller will not take any more action.") + public Boolean getProcessing() { + return processing; + } + + public void setProcessing(Boolean processing) { + this.processing = processing; + } + + public V1alpha3ChallengeStatus reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason contains human readable information on why the Challenge is in the current state. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Reason contains human readable information on why the Challenge is in the current state.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1alpha3ChallengeStatus state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * State contains the current 'state' of the challenge. If not set, the state of the + * challenge is unknown. + * + * @return state + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "State contains the current 'state' of the challenge. If not set, the state of the challenge is unknown.") + public StateEnum getState() { + return state; + } + + public void setState(StateEnum state) { + this.state = state; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ChallengeStatus v1alpha3ChallengeStatus = (V1alpha3ChallengeStatus) o; + return Objects.equals(this.presented, v1alpha3ChallengeStatus.presented) + && Objects.equals(this.processing, v1alpha3ChallengeStatus.processing) + && Objects.equals(this.reason, v1alpha3ChallengeStatus.reason) + && Objects.equals(this.state, v1alpha3ChallengeStatus.state); + } + + @Override + public int hashCode() { + return Objects.hash(presented, processing, reason, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ChallengeStatus {\n"); + sb.append(" presented: ").append(toIndentedString(presented)).append("\n"); + sb.append(" processing: ").append(toIndentedString(processing)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java new file mode 100644 index 0000000000..7497a5645f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java @@ -0,0 +1,217 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and + * therefore can be referenced by resources that exist in *any* namespace, not just the same + * namespace as the referent. + */ +@ApiModel( + description = + "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3ClusterIssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha3ClusterIssuerStatus status; + + public V1alpha3ClusterIssuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3ClusterIssuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3ClusterIssuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3ClusterIssuer spec(V1alpha3ClusterIssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ClusterIssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3ClusterIssuerSpec spec) { + this.spec = spec; + } + + public V1alpha3ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ClusterIssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha3ClusterIssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ClusterIssuer v1alpha3ClusterIssuer = (V1alpha3ClusterIssuer) o; + return Objects.equals(this.apiVersion, v1alpha3ClusterIssuer.apiVersion) + && Objects.equals(this.kind, v1alpha3ClusterIssuer.kind) + && Objects.equals(this.metadata, v1alpha3ClusterIssuer.metadata) + && Objects.equals(this.spec, v1alpha3ClusterIssuer.spec) + && Objects.equals(this.status, v1alpha3ClusterIssuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ClusterIssuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java new file mode 100644 index 0000000000..5f49755faa --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ClusterIssuerList is a list of ClusterIssuer */ +@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3ClusterIssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3ClusterIssuerList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3ClusterIssuerList addItemsItem(V1alpha3ClusterIssuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of clusterissuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3ClusterIssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3ClusterIssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ClusterIssuerList v1alpha3ClusterIssuerList = (V1alpha3ClusterIssuerList) o; + return Objects.equals(this.apiVersion, v1alpha3ClusterIssuerList.apiVersion) + && Objects.equals(this.items, v1alpha3ClusterIssuerList.items) + && Objects.equals(this.kind, v1alpha3ClusterIssuerList.kind) + && Objects.equals(this.metadata, v1alpha3ClusterIssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ClusterIssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java new file mode 100644 index 0000000000..81ddf2be83 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java @@ -0,0 +1,199 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Desired state of the ClusterIssuer resource. */ +@ApiModel(description = "Desired state of the ClusterIssuer resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ClusterIssuerSpec { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1alpha2IssuerSpecAcme acme; + + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1alpha2IssuerSpecCa ca; + + public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; + + @SerializedName(SERIALIZED_NAME_SELF_SIGNED) + private V1alpha2IssuerSpecSelfSigned selfSigned; + + public static final String SERIALIZED_NAME_VAULT = "vault"; + + @SerializedName(SERIALIZED_NAME_VAULT) + private V1alpha2IssuerSpecVault vault; + + public static final String SERIALIZED_NAME_VENAFI = "venafi"; + + @SerializedName(SERIALIZED_NAME_VENAFI) + private V1alpha2IssuerSpecVenafi venafi; + + public V1alpha3ClusterIssuerSpec acme(V1alpha2IssuerSpecAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcme getAcme() { + return acme; + } + + public void setAcme(V1alpha2IssuerSpecAcme acme) { + this.acme = acme; + } + + public V1alpha3ClusterIssuerSpec ca(V1alpha2IssuerSpecCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecCa getCa() { + return ca; + } + + public void setCa(V1alpha2IssuerSpecCa ca) { + this.ca = ca; + } + + public V1alpha3ClusterIssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + + this.selfSigned = selfSigned; + return this; + } + + /** + * Get selfSigned + * + * @return selfSigned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecSelfSigned getSelfSigned() { + return selfSigned; + } + + public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + this.selfSigned = selfSigned; + } + + public V1alpha3ClusterIssuerSpec vault(V1alpha2IssuerSpecVault vault) { + + this.vault = vault; + return this; + } + + /** + * Get vault + * + * @return vault + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVault getVault() { + return vault; + } + + public void setVault(V1alpha2IssuerSpecVault vault) { + this.vault = vault; + } + + public V1alpha3ClusterIssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { + + this.venafi = venafi; + return this; + } + + /** + * Get venafi + * + * @return venafi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafi getVenafi() { + return venafi; + } + + public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { + this.venafi = venafi; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ClusterIssuerSpec v1alpha3ClusterIssuerSpec = (V1alpha3ClusterIssuerSpec) o; + return Objects.equals(this.acme, v1alpha3ClusterIssuerSpec.acme) + && Objects.equals(this.ca, v1alpha3ClusterIssuerSpec.ca) + && Objects.equals(this.selfSigned, v1alpha3ClusterIssuerSpec.selfSigned) + && Objects.equals(this.vault, v1alpha3ClusterIssuerSpec.vault) + && Objects.equals(this.venafi, v1alpha3ClusterIssuerSpec.venafi); + } + + @Override + public int hashCode() { + return Objects.hash(acme, ca, selfSigned, vault, venafi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ClusterIssuerSpec {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); + sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); + sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java new file mode 100644 index 0000000000..cf417e4d0c --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java @@ -0,0 +1,129 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Status of the ClusterIssuer. This is set and managed automatically. */ +@ApiModel(description = "Status of the ClusterIssuer. This is set and managed automatically.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3ClusterIssuerStatus { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1alpha2IssuerStatusAcme acme; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public V1alpha3ClusterIssuerStatus acme(V1alpha2IssuerStatusAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerStatusAcme getAcme() { + return acme; + } + + public void setAcme(V1alpha2IssuerStatusAcme acme) { + this.acme = acme; + } + + public V1alpha3ClusterIssuerStatus conditions(List conditions) { + + this.conditions = conditions; + return this; + } + + public V1alpha3ClusterIssuerStatus addConditionsItem( + V1alpha2IssuerStatusConditions conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of status conditions to indicate the status of a CertificateRequest. Known condition types + * are `Ready`. + * + * @return conditions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready`.") + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3ClusterIssuerStatus v1alpha3ClusterIssuerStatus = (V1alpha3ClusterIssuerStatus) o; + return Objects.equals(this.acme, v1alpha3ClusterIssuerStatus.acme) + && Objects.equals(this.conditions, v1alpha3ClusterIssuerStatus.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(acme, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3ClusterIssuerStatus {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java new file mode 100644 index 0000000000..7bc938fb21 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * An Issuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is scoped to a single namespace and can therefore only be + * referenced by resources within the same namespace. + */ +@ApiModel( + description = + "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3Issuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha2IssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha2IssuerStatus status; + + public V1alpha3Issuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3Issuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3Issuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3Issuer spec(V1alpha2IssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha2IssuerSpec spec) { + this.spec = spec; + } + + public V1alpha3Issuer status(V1alpha2IssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha2IssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3Issuer v1alpha3Issuer = (V1alpha3Issuer) o; + return Objects.equals(this.apiVersion, v1alpha3Issuer.apiVersion) + && Objects.equals(this.kind, v1alpha3Issuer.kind) + && Objects.equals(this.metadata, v1alpha3Issuer.metadata) + && Objects.equals(this.spec, v1alpha3Issuer.spec) + && Objects.equals(this.status, v1alpha3Issuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3Issuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java new file mode 100644 index 0000000000..01574cc4c7 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** IssuerList is a list of Issuer */ +@ApiModel(description = "IssuerList is a list of Issuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3IssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3IssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3IssuerList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3IssuerList addItemsItem(V1alpha3Issuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of issuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3IssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3IssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3IssuerList v1alpha3IssuerList = (V1alpha3IssuerList) o; + return Objects.equals(this.apiVersion, v1alpha3IssuerList.apiVersion) + && Objects.equals(this.items, v1alpha3IssuerList.items) + && Objects.equals(this.kind, v1alpha3IssuerList.kind) + && Objects.equals(this.metadata, v1alpha3IssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3IssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java new file mode 100644 index 0000000000..13057cc119 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java @@ -0,0 +1,209 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Order is a type to represent an Order with an ACME server */ +@ApiModel(description = "Order is a type to represent an Order with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3Order implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha3OrderSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1OrderStatus status; + + public V1alpha3Order apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3Order kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3Order metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1alpha3Order spec(V1alpha3OrderSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3OrderSpec getSpec() { + return spec; + } + + public void setSpec(V1alpha3OrderSpec spec) { + this.spec = spec; + } + + public V1alpha3Order status(V1beta1OrderStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1OrderStatus getStatus() { + return status; + } + + public void setStatus(V1beta1OrderStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3Order v1alpha3Order = (V1alpha3Order) o; + return Objects.equals(this.apiVersion, v1alpha3Order.apiVersion) + && Objects.equals(this.kind, v1alpha3Order.kind) + && Objects.equals(this.metadata, v1alpha3Order.metadata) + && Objects.equals(this.spec, v1alpha3Order.spec) + && Objects.equals(this.status, v1alpha3Order.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3Order {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java new file mode 100644 index 0000000000..ade3cd9485 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** OrderList is a list of Order */ +@ApiModel(description = "OrderList is a list of Order") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3OrderList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1alpha3OrderList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1alpha3OrderList items(List items) { + + this.items = items; + return this; + } + + public V1alpha3OrderList addItemsItem(V1alpha3Order itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of orders. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1alpha3OrderList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1alpha3OrderList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3OrderList v1alpha3OrderList = (V1alpha3OrderList) o; + return Objects.equals(this.apiVersion, v1alpha3OrderList.apiVersion) + && Objects.equals(this.items, v1alpha3OrderList.items) + && Objects.equals(this.kind, v1alpha3OrderList.kind) + && Objects.equals(this.metadata, v1alpha3OrderList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3OrderList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java new file mode 100644 index 0000000000..18224f1085 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** V1alpha3OrderSpec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1alpha3OrderSpec { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_CSR = "csr"; + + @SerializedName(SERIALIZED_NAME_CSR) + private byte[] csr; + + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = new ArrayList(); + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1OrderSpecIssuerRef issuerRef; + + public V1alpha3OrderSpec commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * CommonName is the common name as specified on the DER encoded CSR. If specified, this value + * must also be present in `dnsNames`. This field must match the corresponding field on + * the DER encoded CSR. + * + * @return commonName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CommonName is the common name as specified on the DER encoded CSR. If specified, this value must also be present in `dnsNames`. This field must match the corresponding field on the DER encoded CSR.") + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public V1alpha3OrderSpec csr(byte[] csr) { + + this.csr = csr; + return this; + } + + /** + * Certificate signing request bytes in DER encoding. This will be used when finalizing the order. + * This field must be set on the order. + * + * @return csr + */ + @ApiModelProperty( + required = true, + value = + "Certificate signing request bytes in DER encoding. This will be used when finalizing the order. This field must be set on the order.") + public byte[] getCsr() { + return csr; + } + + public void setCsr(byte[] csr) { + this.csr = csr; + } + + public V1alpha3OrderSpec dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1alpha3OrderSpec addDnsNamesItem(String dnsNamesItem) { + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * DNSNames is a list of DNS names that should be included as part of the Order validation + * process. This field must match the corresponding field on the DER encoded CSR. + * + * @return dnsNames + */ + @ApiModelProperty( + required = true, + value = + "DNSNames is a list of DNS names that should be included as part of the Order validation process. This field must match the corresponding field on the DER encoded CSR.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1alpha3OrderSpec issuerRef(V1beta1OrderSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1OrderSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1OrderSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3OrderSpec v1alpha3OrderSpec = (V1alpha3OrderSpec) o; + return Objects.equals(this.commonName, v1alpha3OrderSpec.commonName) + && Arrays.equals(this.csr, v1alpha3OrderSpec.csr) + && Objects.equals(this.dnsNames, v1alpha3OrderSpec.dnsNames) + && Objects.equals(this.issuerRef, v1alpha3OrderSpec.issuerRef); + } + + @Override + public int hashCode() { + return Objects.hash(commonName, Arrays.hashCode(csr), dnsNames, issuerRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3OrderSpec {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" csr: ").append(toIndentedString(csr)).append("\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java new file mode 100644 index 0000000000..23cc914f59 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java @@ -0,0 +1,215 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A Certificate resource should be created to ensure an up to date and signed x509 certificate is + * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored + * certificate will be renewed before it expires (as configured by `spec.renewBefore`). + */ +@ApiModel( + description = + "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1Certificate implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1CertificateSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateStatus status; + + public V1beta1Certificate apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1Certificate kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1Certificate metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1Certificate spec(V1beta1CertificateSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1CertificateSpec spec) { + this.spec = spec; + } + + public V1beta1Certificate status(V1beta1CertificateStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1Certificate v1beta1Certificate = (V1beta1Certificate) o; + return Objects.equals(this.apiVersion, v1beta1Certificate.apiVersion) + && Objects.equals(this.kind, v1beta1Certificate.kind) + && Objects.equals(this.metadata, v1beta1Certificate.metadata) + && Objects.equals(this.spec, v1beta1Certificate.spec) + && Objects.equals(this.status, v1beta1Certificate.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1Certificate {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java new file mode 100644 index 0000000000..6f080a3e8f --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateList is a list of Certificate */ +@ApiModel(description = "CertificateList is a list of Certificate") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1CertificateList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1CertificateList items(List items) { + + this.items = items; + return this; + } + + public V1beta1CertificateList addItemsItem(V1beta1Certificate itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificates. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1CertificateList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1CertificateList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateList v1beta1CertificateList = (V1beta1CertificateList) o; + return Objects.equals(this.apiVersion, v1beta1CertificateList.apiVersion) + && Objects.equals(this.items, v1beta1CertificateList.items) + && Objects.equals(this.kind, v1beta1CertificateList.kind) + && Objects.equals(this.metadata, v1beta1CertificateList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java new file mode 100644 index 0000000000..6bbb8dd564 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java @@ -0,0 +1,217 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A CertificateRequest is used to request a signed certificate from one of the configured issuers. + * All fields within the CertificateRequest's `spec` are immutable after creation. A + * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. + * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in + * time request for a certificate and cannot be re-used. + */ +@ApiModel( + description = + "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequest implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1CertificateRequestSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1CertificateRequestStatus status; + + public V1beta1CertificateRequest apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1CertificateRequest kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1CertificateRequest metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1CertificateRequest spec(V1beta1CertificateRequestSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateRequestSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1CertificateRequestSpec spec) { + this.spec = spec; + } + + public V1beta1CertificateRequest status(V1beta1CertificateRequestStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateRequestStatus getStatus() { + return status; + } + + public void setStatus(V1beta1CertificateRequestStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequest v1beta1CertificateRequest = (V1beta1CertificateRequest) o; + return Objects.equals(this.apiVersion, v1beta1CertificateRequest.apiVersion) + && Objects.equals(this.kind, v1beta1CertificateRequest.kind) + && Objects.equals(this.metadata, v1beta1CertificateRequest.metadata) + && Objects.equals(this.spec, v1beta1CertificateRequest.spec) + && Objects.equals(this.status, v1beta1CertificateRequest.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequest {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java new file mode 100644 index 0000000000..f98d537f46 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java @@ -0,0 +1,193 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** CertificateRequestList is a list of CertificateRequest */ +@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequestList + implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1CertificateRequestList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1CertificateRequestList items(List items) { + + this.items = items; + return this; + } + + public V1beta1CertificateRequestList addItemsItem(V1beta1CertificateRequest itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of certificaterequests. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1CertificateRequestList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1CertificateRequestList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequestList v1beta1CertificateRequestList = (V1beta1CertificateRequestList) o; + return Objects.equals(this.apiVersion, v1beta1CertificateRequestList.apiVersion) + && Objects.equals(this.items, v1beta1CertificateRequestList.items) + && Objects.equals(this.kind, v1beta1CertificateRequestList.kind) + && Objects.equals(this.metadata, v1beta1CertificateRequestList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequestList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java new file mode 100644 index 0000000000..f5cbe79cf3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java @@ -0,0 +1,326 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** Desired state of the CertificateRequest resource. */ +@ApiModel(description = "Desired state of the CertificateRequest resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequestSpec { + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_IS_C_A = "isCA"; + + @SerializedName(SERIALIZED_NAME_IS_C_A) + private Boolean isCA; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1CertificateRequestSpecIssuerRef issuerRef; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + + @SerializedName(SERIALIZED_NAME_REQUEST) + private byte[] request; + + /** + * KeyUsage specifies valid usage contexts for keys. See: + * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: + * \"signing\", \"digital signature\", \"content commitment\", + * \"key encipherment\", \"key agreement\", \"data encipherment\", + * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher + * only\", \"any\", \"server auth\", \"client auth\", + * \"code signing\", \"email protection\", \"s/mime\", \"ipsec + * end system\", \"ipsec tunnel\", \"ipsec user\", + * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", + * \"netscape sgc\" + */ + @JsonAdapter(UsagesEnum.Adapter.class) + public enum UsagesEnum { + SIGNING("signing"), + + DIGITAL_SIGNATURE("digital signature"), + + CONTENT_COMMITMENT("content commitment"), + + KEY_ENCIPHERMENT("key encipherment"), + + KEY_AGREEMENT("key agreement"), + + DATA_ENCIPHERMENT("data encipherment"), + + CERT_SIGN("cert sign"), + + CRL_SIGN("crl sign"), + + ENCIPHER_ONLY("encipher only"), + + DECIPHER_ONLY("decipher only"), + + ANY("any"), + + SERVER_AUTH("server auth"), + + CLIENT_AUTH("client auth"), + + CODE_SIGNING("code signing"), + + EMAIL_PROTECTION("email protection"), + + S_MIME("s/mime"), + + IPSEC_END_SYSTEM("ipsec end system"), + + IPSEC_TUNNEL("ipsec tunnel"), + + IPSEC_USER("ipsec user"), + + TIMESTAMPING("timestamping"), + + OCSP_SIGNING("ocsp signing"), + + MICROSOFT_SGC("microsoft sgc"), + + NETSCAPE_SGC("netscape sgc"); + + private String value; + + UsagesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsagesEnum fromValue(String value) { + for (UsagesEnum b : UsagesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsagesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsagesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_USAGES = "usages"; + + @SerializedName(SERIALIZED_NAME_USAGES) + private List usages = null; + + public V1beta1CertificateRequestSpec duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be + * ignored/overridden by some issuer types. + * + * @return duration + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types.") + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public V1beta1CertificateRequestSpec isCA(Boolean isCA) { + + this.isCA = isCA; + return this; + } + + /** + * IsCA will request to mark the certificate as valid for certificate signing when submitting to + * the issuer. This will automatically add the `cert sign` usage to the list of + * `usages`. + * + * @return isCA + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IsCA will request to mark the certificate as valid for certificate signing when submitting to the issuer. This will automatically add the `cert sign` usage to the list of `usages`.") + public Boolean getIsCA() { + return isCA; + } + + public void setIsCA(Boolean isCA) { + this.isCA = isCA; + } + + public V1beta1CertificateRequestSpec issuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateRequestSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1beta1CertificateRequestSpec request(byte[] request) { + + this.request = request; + return this; + } + + /** + * The PEM-encoded x509 certificate signing request to be submitted to the CA for signing. + * + * @return request + */ + @ApiModelProperty( + required = true, + value = + "The PEM-encoded x509 certificate signing request to be submitted to the CA for signing.") + public byte[] getRequest() { + return request; + } + + public void setRequest(byte[] request) { + this.request = request; + } + + public V1beta1CertificateRequestSpec usages(List usages) { + + this.usages = usages; + return this; + } + + public V1beta1CertificateRequestSpec addUsagesItem(UsagesEnum usagesItem) { + if (this.usages == null) { + this.usages = new ArrayList(); + } + this.usages.add(usagesItem); + return this; + } + + /** + * Usages is the set of x509 usages that are requested for the certificate. Defaults to + * `digital signature` and `key encipherment` if not specified. + * + * @return usages + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequestSpec v1beta1CertificateRequestSpec = (V1beta1CertificateRequestSpec) o; + return Objects.equals(this.duration, v1beta1CertificateRequestSpec.duration) + && Objects.equals(this.isCA, v1beta1CertificateRequestSpec.isCA) + && Objects.equals(this.issuerRef, v1beta1CertificateRequestSpec.issuerRef) + && Arrays.equals(this.request, v1beta1CertificateRequestSpec.request) + && Objects.equals(this.usages, v1beta1CertificateRequestSpec.usages); + } + + @Override + public int hashCode() { + return Objects.hash(duration, isCA, issuerRef, Arrays.hashCode(request), usages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequestSpec {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java new file mode 100644 index 0000000000..7c0ca58791 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java @@ -0,0 +1,152 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * IssuerRef is a reference to the issuer for this CertificateRequest. If the 'kind' field + * is not set, or set to 'Issuer', an Issuer resource with the given name in the same + * namespace as the CertificateRequest will be used. If the 'kind' field is set to + * 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' + * field in this stanza is required at all times. The group field refers to the API group of the + * issuer which defaults to 'cert-manager.io' if empty. + */ +@ApiModel( + description = + "IssuerRef is a reference to the issuer for this CertificateRequest. If the 'kind' field is not set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as the CertificateRequest will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' field in this stanza is required at all times. The group field refers to the API group of the issuer which defaults to 'cert-manager.io' if empty.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequestSpecIssuerRef { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1CertificateRequestSpecIssuerRef group(String group) { + + this.group = group; + return this; + } + + /** + * Group of the resource being referred to. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group of the resource being referred to.") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1beta1CertificateRequestSpecIssuerRef kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind of the resource being referred to. + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind of the resource being referred to.") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1CertificateRequestSpecIssuerRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of the resource being referred to.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequestSpecIssuerRef v1beta1CertificateRequestSpecIssuerRef = + (V1beta1CertificateRequestSpecIssuerRef) o; + return Objects.equals(this.group, v1beta1CertificateRequestSpecIssuerRef.group) + && Objects.equals(this.kind, v1beta1CertificateRequestSpecIssuerRef.kind) + && Objects.equals(this.name, v1beta1CertificateRequestSpecIssuerRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(group, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequestSpecIssuerRef {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java new file mode 100644 index 0000000000..ef1d7006a5 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java @@ -0,0 +1,200 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** Status of the CertificateRequest. This is set and managed automatically. */ +@ApiModel(description = "Status of the CertificateRequest. This is set and managed automatically.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequestStatus { + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private byte[] ca; + + public static final String SERIALIZED_NAME_CERTIFICATE = "certificate"; + + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + private byte[] certificate; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public static final String SERIALIZED_NAME_FAILURE_TIME = "failureTime"; + + @SerializedName(SERIALIZED_NAME_FAILURE_TIME) + private OffsetDateTime failureTime; + + public V1beta1CertificateRequestStatus ca(byte[] ca) { + + this.ca = ca; + return this; + } + + /** + * The PEM encoded x509 certificate of the signer, also known as the CA (Certificate Authority). + * This is set on a best-effort basis by different issuers. If not set, the CA is assumed to be + * unknown/not available. + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The PEM encoded x509 certificate of the signer, also known as the CA (Certificate Authority). This is set on a best-effort basis by different issuers. If not set, the CA is assumed to be unknown/not available.") + public byte[] getCa() { + return ca; + } + + public void setCa(byte[] ca) { + this.ca = ca; + } + + public V1beta1CertificateRequestStatus certificate(byte[] certificate) { + + this.certificate = certificate; + return this; + } + + /** + * The PEM encoded x509 certificate resulting from the certificate signing request. If not set, + * the CertificateRequest has either not been completed or has failed. More information on failure + * can be found by checking the `conditions` field. + * + * @return certificate + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The PEM encoded x509 certificate resulting from the certificate signing request. If not set, the CertificateRequest has either not been completed or has failed. More information on failure can be found by checking the `conditions` field.") + public byte[] getCertificate() { + return certificate; + } + + public void setCertificate(byte[] certificate) { + this.certificate = certificate; + } + + public V1beta1CertificateRequestStatus conditions( + List conditions) { + + this.conditions = conditions; + return this; + } + + public V1beta1CertificateRequestStatus addConditionsItem( + V1beta1CertificateRequestStatusConditions conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of status conditions to indicate the status of a CertificateRequest. Known condition types + * are `Ready` and `InvalidRequest`. + * + * @return conditions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready` and `InvalidRequest`.") + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + public V1beta1CertificateRequestStatus failureTime(OffsetDateTime failureTime) { + + this.failureTime = failureTime; + return this; + } + + /** + * FailureTime stores the time that this CertificateRequest failed. This is used to influence + * garbage collection and back-off. + * + * @return failureTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "FailureTime stores the time that this CertificateRequest failed. This is used to influence garbage collection and back-off.") + public OffsetDateTime getFailureTime() { + return failureTime; + } + + public void setFailureTime(OffsetDateTime failureTime) { + this.failureTime = failureTime; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequestStatus v1beta1CertificateRequestStatus = + (V1beta1CertificateRequestStatus) o; + return Arrays.equals(this.ca, v1beta1CertificateRequestStatus.ca) + && Arrays.equals(this.certificate, v1beta1CertificateRequestStatus.certificate) + && Objects.equals(this.conditions, v1beta1CertificateRequestStatus.conditions) + && Objects.equals(this.failureTime, v1beta1CertificateRequestStatus.failureTime); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(ca), Arrays.hashCode(certificate), conditions, failureTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequestStatus {\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" failureTime: ").append(toIndentedString(failureTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java new file mode 100644 index 0000000000..7811ef5b65 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java @@ -0,0 +1,266 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** CertificateRequestCondition contains condition information for a CertificateRequest. */ +@ApiModel( + description = + "CertificateRequestCondition contains condition information for a CertificateRequest.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateRequestStatusConditions { + public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; + + @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) + private OffsetDateTime lastTransitionTime; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** Status of the condition, one of ('True', 'False', 'Unknown'). */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + TRUE("True"), + + FALSE("False"), + + UNKNOWN("Unknown"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public V1beta1CertificateRequestStatusConditions lastTransitionTime( + OffsetDateTime lastTransitionTime) { + + this.lastTransitionTime = lastTransitionTime; + return this; + } + + /** + * LastTransitionTime is the timestamp corresponding to the last status change of this condition. + * + * @return lastTransitionTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") + public OffsetDateTime getLastTransitionTime() { + return lastTransitionTime; + } + + public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { + this.lastTransitionTime = lastTransitionTime; + } + + public V1beta1CertificateRequestStatusConditions message(String message) { + + this.message = message; + return this; + } + + /** + * Message is a human readable description of the details of the last transition, complementing + * reason. + * + * @return message + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Message is a human readable description of the details of the last transition, complementing reason.") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public V1beta1CertificateRequestStatusConditions reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason is a brief machine readable explanation for the condition's last transition. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Reason is a brief machine readable explanation for the condition's last transition.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1beta1CertificateRequestStatusConditions status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the condition, one of ('True', 'False', 'Unknown'). + * + * @return status + */ + @ApiModelProperty( + required = true, + value = "Status of the condition, one of ('True', 'False', 'Unknown').") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public V1beta1CertificateRequestStatusConditions type(String type) { + + this.type = type; + return this; + } + + /** + * Type of the condition, known values are ('Ready', 'InvalidRequest'). + * + * @return type + */ + @ApiModelProperty( + required = true, + value = "Type of the condition, known values are ('Ready', 'InvalidRequest').") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateRequestStatusConditions v1beta1CertificateRequestStatusConditions = + (V1beta1CertificateRequestStatusConditions) o; + return Objects.equals( + this.lastTransitionTime, v1beta1CertificateRequestStatusConditions.lastTransitionTime) + && Objects.equals(this.message, v1beta1CertificateRequestStatusConditions.message) + && Objects.equals(this.reason, v1beta1CertificateRequestStatusConditions.reason) + && Objects.equals(this.status, v1beta1CertificateRequestStatusConditions.status) + && Objects.equals(this.type, v1beta1CertificateRequestStatusConditions.type); + } + + @Override + public int hashCode() { + return Objects.hash(lastTransitionTime, message, reason, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateRequestStatusConditions {\n"); + sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java new file mode 100644 index 0000000000..581c319456 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java @@ -0,0 +1,640 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Desired state of the Certificate resource. */ +@ApiModel(description = "Desired state of the Certificate resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpec { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = null; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; + + @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) + private List emailSANs = null; + + public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; + + @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) + private List ipAddresses = null; + + public static final String SERIALIZED_NAME_IS_C_A = "isCA"; + + @SerializedName(SERIALIZED_NAME_IS_C_A) + private Boolean isCA; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1CertificateSpecIssuerRef issuerRef; + + public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; + + @SerializedName(SERIALIZED_NAME_KEYSTORES) + private V1beta1CertificateSpecKeystores keystores; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private V1beta1CertificateSpecPrivateKey privateKey; + + public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; + + @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) + private String renewBefore; + + public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; + + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + private String secretName; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + + @SerializedName(SERIALIZED_NAME_SUBJECT) + private V1beta1CertificateSpecSubject subject; + + public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; + + @SerializedName(SERIALIZED_NAME_URI_S_A_NS) + private List uriSANs = null; + + /** + * KeyUsage specifies valid usage contexts for keys. See: + * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: + * \"signing\", \"digital signature\", \"content commitment\", + * \"key encipherment\", \"key agreement\", \"data encipherment\", + * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher + * only\", \"any\", \"server auth\", \"client auth\", + * \"code signing\", \"email protection\", \"s/mime\", \"ipsec + * end system\", \"ipsec tunnel\", \"ipsec user\", + * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", + * \"netscape sgc\" + */ + @JsonAdapter(UsagesEnum.Adapter.class) + public enum UsagesEnum { + SIGNING("signing"), + + DIGITAL_SIGNATURE("digital signature"), + + CONTENT_COMMITMENT("content commitment"), + + KEY_ENCIPHERMENT("key encipherment"), + + KEY_AGREEMENT("key agreement"), + + DATA_ENCIPHERMENT("data encipherment"), + + CERT_SIGN("cert sign"), + + CRL_SIGN("crl sign"), + + ENCIPHER_ONLY("encipher only"), + + DECIPHER_ONLY("decipher only"), + + ANY("any"), + + SERVER_AUTH("server auth"), + + CLIENT_AUTH("client auth"), + + CODE_SIGNING("code signing"), + + EMAIL_PROTECTION("email protection"), + + S_MIME("s/mime"), + + IPSEC_END_SYSTEM("ipsec end system"), + + IPSEC_TUNNEL("ipsec tunnel"), + + IPSEC_USER("ipsec user"), + + TIMESTAMPING("timestamping"), + + OCSP_SIGNING("ocsp signing"), + + MICROSOFT_SGC("microsoft sgc"), + + NETSCAPE_SGC("netscape sgc"); + + private String value; + + UsagesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UsagesEnum fromValue(String value) { + for (UsagesEnum b : UsagesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UsagesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UsagesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_USAGES = "usages"; + + @SerializedName(SERIALIZED_NAME_USAGES) + private List usages = null; + + public V1beta1CertificateSpec commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * CommonName is a common name to be used on the Certificate. The CommonName should have a length + * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS + * clients when any subject alt name is set. This is x509 behaviour: + * https://tools.ietf.org/html/rfc6125#section-6.4.4 + * + * @return commonName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public V1beta1CertificateSpec dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1beta1CertificateSpec addDnsNamesItem(String dnsNamesItem) { + if (this.dnsNames == null) { + this.dnsNames = new ArrayList(); + } + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + * + * @return dnsNames + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1beta1CertificateSpec duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be + * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater + * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of + * the way through the certificate's duration. + * + * @return duration + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public V1beta1CertificateSpec emailSANs(List emailSANs) { + + this.emailSANs = emailSANs; + return this; + } + + public V1beta1CertificateSpec addEmailSANsItem(String emailSANsItem) { + if (this.emailSANs == null) { + this.emailSANs = new ArrayList(); + } + this.emailSANs.add(emailSANsItem); + return this; + } + + /** + * EmailSANs is a list of email subjectAltNames to be set on the Certificate. + * + * @return emailSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") + public List getEmailSANs() { + return emailSANs; + } + + public void setEmailSANs(List emailSANs) { + this.emailSANs = emailSANs; + } + + public V1beta1CertificateSpec ipAddresses(List ipAddresses) { + + this.ipAddresses = ipAddresses; + return this; + } + + public V1beta1CertificateSpec addIpAddressesItem(String ipAddressesItem) { + if (this.ipAddresses == null) { + this.ipAddresses = new ArrayList(); + } + this.ipAddresses.add(ipAddressesItem); + return this; + } + + /** + * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + * + * @return ipAddresses + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") + public List getIpAddresses() { + return ipAddresses; + } + + public void setIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + } + + public V1beta1CertificateSpec isCA(Boolean isCA) { + + this.isCA = isCA; + return this; + } + + /** + * IsCA will mark this Certificate as valid for certificate signing. This will automatically add + * the `cert sign` usage to the list of `usages`. + * + * @return isCA + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") + public Boolean getIsCA() { + return isCA; + } + + public void setIsCA(Boolean isCA) { + this.isCA = isCA; + } + + public V1beta1CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1beta1CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { + + this.keystores = keystores; + return this; + } + + /** + * Get keystores + * + * @return keystores + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecKeystores getKeystores() { + return keystores; + } + + public void setKeystores(V1beta1CertificateSpecKeystores keystores) { + this.keystores = keystores; + } + + public V1beta1CertificateSpec privateKey(V1beta1CertificateSpecPrivateKey privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * + * @return privateKey + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecPrivateKey getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(V1beta1CertificateSpecPrivateKey privateKey) { + this.privateKey = privateKey; + } + + public V1beta1CertificateSpec renewBefore(String renewBefore) { + + this.renewBefore = renewBefore; + return this; + } + + /** + * The amount of time before the currently issued certificate's `notAfter` time that + * cert-manager will begin to attempt to renew the certificate. If this value is greater than the + * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed + * 2/3rds of the way through the certificate's duration. + * + * @return renewBefore + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") + public String getRenewBefore() { + return renewBefore; + } + + public void setRenewBefore(String renewBefore) { + this.renewBefore = renewBefore; + } + + public V1beta1CertificateSpec secretName(String secretName) { + + this.secretName = secretName; + return this; + } + + /** + * SecretName is the name of the secret resource that will be automatically created and managed by + * this Certificate resource. It will be populated with a private key and certificate, signed by + * the denoted issuer. + * + * @return secretName + */ + @ApiModelProperty( + required = true, + value = + "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") + public String getSecretName() { + return secretName; + } + + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + public V1beta1CertificateSpec subject(V1beta1CertificateSpecSubject subject) { + + this.subject = subject; + return this; + } + + /** + * Get subject + * + * @return subject + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecSubject getSubject() { + return subject; + } + + public void setSubject(V1beta1CertificateSpecSubject subject) { + this.subject = subject; + } + + public V1beta1CertificateSpec uriSANs(List uriSANs) { + + this.uriSANs = uriSANs; + return this; + } + + public V1beta1CertificateSpec addUriSANsItem(String uriSANsItem) { + if (this.uriSANs == null) { + this.uriSANs = new ArrayList(); + } + this.uriSANs.add(uriSANsItem); + return this; + } + + /** + * URISANs is a list of URI subjectAltNames to be set on the Certificate. + * + * @return uriSANs + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") + public List getUriSANs() { + return uriSANs; + } + + public void setUriSANs(List uriSANs) { + this.uriSANs = uriSANs; + } + + public V1beta1CertificateSpec usages(List usages) { + + this.usages = usages; + return this; + } + + public V1beta1CertificateSpec addUsagesItem(UsagesEnum usagesItem) { + if (this.usages == null) { + this.usages = new ArrayList(); + } + this.usages.add(usagesItem); + return this; + } + + /** + * Usages is the set of x509 usages that are requested for the certificate. Defaults to + * `digital signature` and `key encipherment` if not specified. + * + * @return usages + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpec v1beta1CertificateSpec = (V1beta1CertificateSpec) o; + return Objects.equals(this.commonName, v1beta1CertificateSpec.commonName) + && Objects.equals(this.dnsNames, v1beta1CertificateSpec.dnsNames) + && Objects.equals(this.duration, v1beta1CertificateSpec.duration) + && Objects.equals(this.emailSANs, v1beta1CertificateSpec.emailSANs) + && Objects.equals(this.ipAddresses, v1beta1CertificateSpec.ipAddresses) + && Objects.equals(this.isCA, v1beta1CertificateSpec.isCA) + && Objects.equals(this.issuerRef, v1beta1CertificateSpec.issuerRef) + && Objects.equals(this.keystores, v1beta1CertificateSpec.keystores) + && Objects.equals(this.privateKey, v1beta1CertificateSpec.privateKey) + && Objects.equals(this.renewBefore, v1beta1CertificateSpec.renewBefore) + && Objects.equals(this.secretName, v1beta1CertificateSpec.secretName) + && Objects.equals(this.subject, v1beta1CertificateSpec.subject) + && Objects.equals(this.uriSANs, v1beta1CertificateSpec.uriSANs) + && Objects.equals(this.usages, v1beta1CertificateSpec.usages); + } + + @Override + public int hashCode() { + return Objects.hash( + commonName, + dnsNames, + duration, + emailSANs, + ipAddresses, + isCA, + issuerRef, + keystores, + privateKey, + renewBefore, + secretName, + subject, + uriSANs, + usages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpec {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); + sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); + sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); + sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java new file mode 100644 index 0000000000..6a0a1ee6d9 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java @@ -0,0 +1,151 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * IssuerRef is a reference to the issuer for this certificate. If the 'kind' field is not + * set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as + * the Certificate will be used. If the 'kind' field is set to 'ClusterIssuer', a + * ClusterIssuer with the provided name will be used. The 'name' field in this stanza is + * required at all times. + */ +@ApiModel( + description = + "IssuerRef is a reference to the issuer for this certificate. If the 'kind' field is not set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as the Certificate will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' field in this stanza is required at all times.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecIssuerRef { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1CertificateSpecIssuerRef group(String group) { + + this.group = group; + return this; + } + + /** + * Group of the resource being referred to. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group of the resource being referred to.") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1beta1CertificateSpecIssuerRef kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind of the resource being referred to. + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind of the resource being referred to.") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1CertificateSpecIssuerRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of the resource being referred to.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecIssuerRef v1beta1CertificateSpecIssuerRef = + (V1beta1CertificateSpecIssuerRef) o; + return Objects.equals(this.group, v1beta1CertificateSpecIssuerRef.group) + && Objects.equals(this.kind, v1beta1CertificateSpecIssuerRef.kind) + && Objects.equals(this.name, v1beta1CertificateSpecIssuerRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(group, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecIssuerRef {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java new file mode 100644 index 0000000000..5e6e4170f4 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java @@ -0,0 +1,121 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Keystores configures additional keystore output formats stored in the `secretName` + * Secret resource. + */ +@ApiModel( + description = + "Keystores configures additional keystore output formats stored in the `secretName` Secret resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecKeystores { + public static final String SERIALIZED_NAME_JKS = "jks"; + + @SerializedName(SERIALIZED_NAME_JKS) + private V1beta1CertificateSpecKeystoresJks jks; + + public static final String SERIALIZED_NAME_PKCS12 = "pkcs12"; + + @SerializedName(SERIALIZED_NAME_PKCS12) + private V1beta1CertificateSpecKeystoresPkcs12 pkcs12; + + public V1beta1CertificateSpecKeystores jks(V1beta1CertificateSpecKeystoresJks jks) { + + this.jks = jks; + return this; + } + + /** + * Get jks + * + * @return jks + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecKeystoresJks getJks() { + return jks; + } + + public void setJks(V1beta1CertificateSpecKeystoresJks jks) { + this.jks = jks; + } + + public V1beta1CertificateSpecKeystores pkcs12(V1beta1CertificateSpecKeystoresPkcs12 pkcs12) { + + this.pkcs12 = pkcs12; + return this; + } + + /** + * Get pkcs12 + * + * @return pkcs12 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1CertificateSpecKeystoresPkcs12 getPkcs12() { + return pkcs12; + } + + public void setPkcs12(V1beta1CertificateSpecKeystoresPkcs12 pkcs12) { + this.pkcs12 = pkcs12; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecKeystores v1beta1CertificateSpecKeystores = + (V1beta1CertificateSpecKeystores) o; + return Objects.equals(this.jks, v1beta1CertificateSpecKeystores.jks) + && Objects.equals(this.pkcs12, v1beta1CertificateSpecKeystores.pkcs12); + } + + @Override + public int hashCode() { + return Objects.hash(jks, pkcs12); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecKeystores {\n"); + sb.append(" jks: ").append(toIndentedString(jks)).append("\n"); + sb.append(" pkcs12: ").append(toIndentedString(pkcs12)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java new file mode 100644 index 0000000000..0e53673f86 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * JKS configures options for storing a JKS keystore in the `spec.secretName` Secret + * resource. + */ +@ApiModel( + description = + "JKS configures options for storing a JKS keystore in the `spec.secretName` Secret resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecKeystoresJks { + public static final String SERIALIZED_NAME_CREATE = "create"; + + @SerializedName(SERIALIZED_NAME_CREATE) + private Boolean create; + + public static final String SERIALIZED_NAME_PASSWORD_SECRET_REF = "passwordSecretRef"; + + @SerializedName(SERIALIZED_NAME_PASSWORD_SECRET_REF) + private V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef; + + public V1beta1CertificateSpecKeystoresJks create(Boolean create) { + + this.create = create; + return this; + } + + /** + * Create enables JKS keystore creation for the Certificate. If true, a file named + * `keystore.jks` will be created in the target Secret resource, encrypted using the + * password stored in `passwordSecretRef`. The keystore file will only be updated upon + * re-issuance. + * + * @return create + */ + @ApiModelProperty( + required = true, + value = + "Create enables JKS keystore creation for the Certificate. If true, a file named `keystore.jks` will be created in the target Secret resource, encrypted using the password stored in `passwordSecretRef`. The keystore file will only be updated upon re-issuance.") + public Boolean getCreate() { + return create; + } + + public void setCreate(Boolean create) { + this.create = create; + } + + public V1beta1CertificateSpecKeystoresJks passwordSecretRef( + V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef) { + + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Get passwordSecretRef + * + * @return passwordSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpecKeystoresJksPasswordSecretRef getPasswordSecretRef() { + return passwordSecretRef; + } + + public void setPasswordSecretRef( + V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecKeystoresJks v1beta1CertificateSpecKeystoresJks = + (V1beta1CertificateSpecKeystoresJks) o; + return Objects.equals(this.create, v1beta1CertificateSpecKeystoresJks.create) + && Objects.equals( + this.passwordSecretRef, v1beta1CertificateSpecKeystoresJks.passwordSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(create, passwordSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecKeystoresJks {\n"); + sb.append(" create: ").append(toIndentedString(create)).append("\n"); + sb.append(" passwordSecretRef: ").append(toIndentedString(passwordSecretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java new file mode 100644 index 0000000000..38d56de8c9 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PasswordSecretRef is a reference to a key in a Secret resource containing the password used to + * encrypt the JKS keystore. + */ +@ApiModel( + description = + "PasswordSecretRef is a reference to a key in a Secret resource containing the password used to encrypt the JKS keystore.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecKeystoresJksPasswordSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1CertificateSpecKeystoresJksPasswordSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1beta1CertificateSpecKeystoresJksPasswordSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecKeystoresJksPasswordSecretRef + v1beta1CertificateSpecKeystoresJksPasswordSecretRef = + (V1beta1CertificateSpecKeystoresJksPasswordSecretRef) o; + return Objects.equals(this.key, v1beta1CertificateSpecKeystoresJksPasswordSecretRef.key) + && Objects.equals(this.name, v1beta1CertificateSpecKeystoresJksPasswordSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecKeystoresJksPasswordSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java new file mode 100644 index 0000000000..31af898a58 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PKCS12 configures options for storing a PKCS12 keystore in the `spec.secretName` Secret + * resource. + */ +@ApiModel( + description = + "PKCS12 configures options for storing a PKCS12 keystore in the `spec.secretName` Secret resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecKeystoresPkcs12 { + public static final String SERIALIZED_NAME_CREATE = "create"; + + @SerializedName(SERIALIZED_NAME_CREATE) + private Boolean create; + + public static final String SERIALIZED_NAME_PASSWORD_SECRET_REF = "passwordSecretRef"; + + @SerializedName(SERIALIZED_NAME_PASSWORD_SECRET_REF) + private V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef; + + public V1beta1CertificateSpecKeystoresPkcs12 create(Boolean create) { + + this.create = create; + return this; + } + + /** + * Create enables PKCS12 keystore creation for the Certificate. If true, a file named + * `keystore.p12` will be created in the target Secret resource, encrypted using the + * password stored in `passwordSecretRef`. The keystore file will only be updated upon + * re-issuance. + * + * @return create + */ + @ApiModelProperty( + required = true, + value = + "Create enables PKCS12 keystore creation for the Certificate. If true, a file named `keystore.p12` will be created in the target Secret resource, encrypted using the password stored in `passwordSecretRef`. The keystore file will only be updated upon re-issuance.") + public Boolean getCreate() { + return create; + } + + public void setCreate(Boolean create) { + this.create = create; + } + + public V1beta1CertificateSpecKeystoresPkcs12 passwordSecretRef( + V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef) { + + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Get passwordSecretRef + * + * @return passwordSecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef getPasswordSecretRef() { + return passwordSecretRef; + } + + public void setPasswordSecretRef( + V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecKeystoresPkcs12 v1beta1CertificateSpecKeystoresPkcs12 = + (V1beta1CertificateSpecKeystoresPkcs12) o; + return Objects.equals(this.create, v1beta1CertificateSpecKeystoresPkcs12.create) + && Objects.equals( + this.passwordSecretRef, v1beta1CertificateSpecKeystoresPkcs12.passwordSecretRef); + } + + @Override + public int hashCode() { + return Objects.hash(create, passwordSecretRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecKeystoresPkcs12 {\n"); + sb.append(" create: ").append(toIndentedString(create)).append("\n"); + sb.append(" passwordSecretRef: ").append(toIndentedString(passwordSecretRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java new file mode 100644 index 0000000000..5a1b17bf30 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * PasswordSecretRef is a reference to a key in a Secret resource containing the password used to + * encrypt the PKCS12 keystore. + */ +@ApiModel( + description = + "PasswordSecretRef is a reference to a key in a Secret resource containing the password used to encrypt the PKCS12 keystore.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef { + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry in the Secret resource's `data` field to be used. Some + * instances of this field may be defaulted, in others it may be required. + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * + * @return name + */ + @ApiModelProperty( + required = true, + value = + "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef + v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef = + (V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef) o; + return Objects.equals(this.key, v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.key) + && Objects.equals(this.name, v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(key, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java new file mode 100644 index 0000000000..dce8b53538 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java @@ -0,0 +1,303 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** Options to control private keys used for the Certificate. */ +@ApiModel(description = "Options to control private keys used for the Certificate.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecPrivateKey { + /** + * Algorithm is the private key algorithm of the corresponding private key for this certificate. + * If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `algorithm` is specified and `size` is not provided, key size of 256 will + * be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + */ + @JsonAdapter(AlgorithmEnum.Adapter.class) + public enum AlgorithmEnum { + RSA("RSA"), + + ECDSA("ECDSA"); + + private String value; + + AlgorithmEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AlgorithmEnum fromValue(String value) { + for (AlgorithmEnum b : AlgorithmEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AlgorithmEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AlgorithmEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AlgorithmEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; + + @SerializedName(SERIALIZED_NAME_ALGORITHM) + private AlgorithmEnum algorithm; + + /** + * The private key cryptography standards (PKCS) encoding for this certificate's private key + * to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" + * standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified. + */ + @JsonAdapter(EncodingEnum.Adapter.class) + public enum EncodingEnum { + PKCS1("PKCS1"), + + PKCS8("PKCS8"); + + private String value; + + EncodingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EncodingEnum fromValue(String value) { + for (EncodingEnum b : EncodingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EncodingEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EncodingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EncodingEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENCODING = "encoding"; + + @SerializedName(SERIALIZED_NAME_ENCODING) + private EncodingEnum encoding; + + public static final String SERIALIZED_NAME_ROTATION_POLICY = "rotationPolicy"; + + @SerializedName(SERIALIZED_NAME_ROTATION_POLICY) + private String rotationPolicy; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private Integer size; + + public V1beta1CertificateSpecPrivateKey algorithm(AlgorithmEnum algorithm) { + + this.algorithm = algorithm; + return this; + } + + /** + * Algorithm is the private key algorithm of the corresponding private key for this certificate. + * If provided, allowed values are either \"rsa\" or \"ecdsa\" If + * `algorithm` is specified and `size` is not provided, key size of 256 will + * be used for \"ecdsa\" key algorithm and key size of 2048 will be used for + * \"rsa\" key algorithm. + * + * @return algorithm + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `algorithm` is specified and `size` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") + public AlgorithmEnum getAlgorithm() { + return algorithm; + } + + public void setAlgorithm(AlgorithmEnum algorithm) { + this.algorithm = algorithm; + } + + public V1beta1CertificateSpecPrivateKey encoding(EncodingEnum encoding) { + + this.encoding = encoding; + return this; + } + + /** + * The private key cryptography standards (PKCS) encoding for this certificate's private key + * to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" + * standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified. + * + * @return encoding + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified.") + public EncodingEnum getEncoding() { + return encoding; + } + + public void setEncoding(EncodingEnum encoding) { + this.encoding = encoding; + } + + public V1beta1CertificateSpecPrivateKey rotationPolicy(String rotationPolicy) { + + this.rotationPolicy = rotationPolicy; + return this; + } + + /** + * RotationPolicy controls how private keys should be regenerated when a re-issuance is being + * processed. If set to Never, a private key will only be generated if one does not already exist + * in the target `spec.secretName`. If one does exists but it does not have the correct + * algorithm or size, a warning will be raised to await user intervention. If set to Always, a + * private key matching the specified requirements will be generated whenever a re-issuance + * occurs. Default is 'Never' for backward compatibility. + * + * @return rotationPolicy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility.") + public String getRotationPolicy() { + return rotationPolicy; + } + + public void setRotationPolicy(String rotationPolicy) { + this.rotationPolicy = rotationPolicy; + } + + public V1beta1CertificateSpecPrivateKey size(Integer size) { + + this.size = size; + return this; + } + + /** + * Size is the key bit size of the corresponding private key for this certificate. If + * `algorithm` is set to `RSA`, valid values are `2048`, + * `4096` or `8192`, and will default to `2048` if not specified. If + * `algorithm` is set to `ECDSA`, valid values are `256`, + * `384` or `521`, and will default to `256` if not specified. No + * other values are allowed. minimum: 0 maximum: 8192 + * + * @return size + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecPrivateKey v1beta1CertificateSpecPrivateKey = + (V1beta1CertificateSpecPrivateKey) o; + return Objects.equals(this.algorithm, v1beta1CertificateSpecPrivateKey.algorithm) + && Objects.equals(this.encoding, v1beta1CertificateSpecPrivateKey.encoding) + && Objects.equals(this.rotationPolicy, v1beta1CertificateSpecPrivateKey.rotationPolicy) + && Objects.equals(this.size, v1beta1CertificateSpecPrivateKey.size); + } + + @Override + public int hashCode() { + return Objects.hash(algorithm, encoding, rotationPolicy, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecPrivateKey {\n"); + sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" rotationPolicy: ").append(toIndentedString(rotationPolicy)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java new file mode 100644 index 0000000000..56a2bc0369 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java @@ -0,0 +1,353 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). */ +@ApiModel( + description = "Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name).") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateSpecSubject { + public static final String SERIALIZED_NAME_COUNTRIES = "countries"; + + @SerializedName(SERIALIZED_NAME_COUNTRIES) + private List countries = null; + + public static final String SERIALIZED_NAME_LOCALITIES = "localities"; + + @SerializedName(SERIALIZED_NAME_LOCALITIES) + private List localities = null; + + public static final String SERIALIZED_NAME_ORGANIZATIONAL_UNITS = "organizationalUnits"; + + @SerializedName(SERIALIZED_NAME_ORGANIZATIONAL_UNITS) + private List organizationalUnits = null; + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; + + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + private List organizations = null; + + public static final String SERIALIZED_NAME_POSTAL_CODES = "postalCodes"; + + @SerializedName(SERIALIZED_NAME_POSTAL_CODES) + private List postalCodes = null; + + public static final String SERIALIZED_NAME_PROVINCES = "provinces"; + + @SerializedName(SERIALIZED_NAME_PROVINCES) + private List provinces = null; + + public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serialNumber"; + + @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) + private String serialNumber; + + public static final String SERIALIZED_NAME_STREET_ADDRESSES = "streetAddresses"; + + @SerializedName(SERIALIZED_NAME_STREET_ADDRESSES) + private List streetAddresses = null; + + public V1beta1CertificateSpecSubject countries(List countries) { + + this.countries = countries; + return this; + } + + public V1beta1CertificateSpecSubject addCountriesItem(String countriesItem) { + if (this.countries == null) { + this.countries = new ArrayList(); + } + this.countries.add(countriesItem); + return this; + } + + /** + * Countries to be used on the Certificate. + * + * @return countries + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Countries to be used on the Certificate.") + public List getCountries() { + return countries; + } + + public void setCountries(List countries) { + this.countries = countries; + } + + public V1beta1CertificateSpecSubject localities(List localities) { + + this.localities = localities; + return this; + } + + public V1beta1CertificateSpecSubject addLocalitiesItem(String localitiesItem) { + if (this.localities == null) { + this.localities = new ArrayList(); + } + this.localities.add(localitiesItem); + return this; + } + + /** + * Cities to be used on the Certificate. + * + * @return localities + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Cities to be used on the Certificate.") + public List getLocalities() { + return localities; + } + + public void setLocalities(List localities) { + this.localities = localities; + } + + public V1beta1CertificateSpecSubject organizationalUnits(List organizationalUnits) { + + this.organizationalUnits = organizationalUnits; + return this; + } + + public V1beta1CertificateSpecSubject addOrganizationalUnitsItem(String organizationalUnitsItem) { + if (this.organizationalUnits == null) { + this.organizationalUnits = new ArrayList(); + } + this.organizationalUnits.add(organizationalUnitsItem); + return this; + } + + /** + * Organizational Units to be used on the Certificate. + * + * @return organizationalUnits + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Organizational Units to be used on the Certificate.") + public List getOrganizationalUnits() { + return organizationalUnits; + } + + public void setOrganizationalUnits(List organizationalUnits) { + this.organizationalUnits = organizationalUnits; + } + + public V1beta1CertificateSpecSubject organizations(List organizations) { + + this.organizations = organizations; + return this; + } + + public V1beta1CertificateSpecSubject addOrganizationsItem(String organizationsItem) { + if (this.organizations == null) { + this.organizations = new ArrayList(); + } + this.organizations.add(organizationsItem); + return this; + } + + /** + * Organizations to be used on the Certificate. + * + * @return organizations + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Organizations to be used on the Certificate.") + public List getOrganizations() { + return organizations; + } + + public void setOrganizations(List organizations) { + this.organizations = organizations; + } + + public V1beta1CertificateSpecSubject postalCodes(List postalCodes) { + + this.postalCodes = postalCodes; + return this; + } + + public V1beta1CertificateSpecSubject addPostalCodesItem(String postalCodesItem) { + if (this.postalCodes == null) { + this.postalCodes = new ArrayList(); + } + this.postalCodes.add(postalCodesItem); + return this; + } + + /** + * Postal codes to be used on the Certificate. + * + * @return postalCodes + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Postal codes to be used on the Certificate.") + public List getPostalCodes() { + return postalCodes; + } + + public void setPostalCodes(List postalCodes) { + this.postalCodes = postalCodes; + } + + public V1beta1CertificateSpecSubject provinces(List provinces) { + + this.provinces = provinces; + return this; + } + + public V1beta1CertificateSpecSubject addProvincesItem(String provincesItem) { + if (this.provinces == null) { + this.provinces = new ArrayList(); + } + this.provinces.add(provincesItem); + return this; + } + + /** + * State/Provinces to be used on the Certificate. + * + * @return provinces + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "State/Provinces to be used on the Certificate.") + public List getProvinces() { + return provinces; + } + + public void setProvinces(List provinces) { + this.provinces = provinces; + } + + public V1beta1CertificateSpecSubject serialNumber(String serialNumber) { + + this.serialNumber = serialNumber; + return this; + } + + /** + * Serial number to be used on the Certificate. + * + * @return serialNumber + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Serial number to be used on the Certificate.") + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public V1beta1CertificateSpecSubject streetAddresses(List streetAddresses) { + + this.streetAddresses = streetAddresses; + return this; + } + + public V1beta1CertificateSpecSubject addStreetAddressesItem(String streetAddressesItem) { + if (this.streetAddresses == null) { + this.streetAddresses = new ArrayList(); + } + this.streetAddresses.add(streetAddressesItem); + return this; + } + + /** + * Street addresses to be used on the Certificate. + * + * @return streetAddresses + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Street addresses to be used on the Certificate.") + public List getStreetAddresses() { + return streetAddresses; + } + + public void setStreetAddresses(List streetAddresses) { + this.streetAddresses = streetAddresses; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateSpecSubject v1beta1CertificateSpecSubject = (V1beta1CertificateSpecSubject) o; + return Objects.equals(this.countries, v1beta1CertificateSpecSubject.countries) + && Objects.equals(this.localities, v1beta1CertificateSpecSubject.localities) + && Objects.equals( + this.organizationalUnits, v1beta1CertificateSpecSubject.organizationalUnits) + && Objects.equals(this.organizations, v1beta1CertificateSpecSubject.organizations) + && Objects.equals(this.postalCodes, v1beta1CertificateSpecSubject.postalCodes) + && Objects.equals(this.provinces, v1beta1CertificateSpecSubject.provinces) + && Objects.equals(this.serialNumber, v1beta1CertificateSpecSubject.serialNumber) + && Objects.equals(this.streetAddresses, v1beta1CertificateSpecSubject.streetAddresses); + } + + @Override + public int hashCode() { + return Objects.hash( + countries, + localities, + organizationalUnits, + organizations, + postalCodes, + provinces, + serialNumber, + streetAddresses); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateSpecSubject {\n"); + sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); + sb.append(" localities: ").append(toIndentedString(localities)).append("\n"); + sb.append(" organizationalUnits: ") + .append(toIndentedString(organizationalUnits)) + .append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" postalCodes: ").append(toIndentedString(postalCodes)).append("\n"); + sb.append(" provinces: ").append(toIndentedString(provinces)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" streetAddresses: ").append(toIndentedString(streetAddresses)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java new file mode 100644 index 0000000000..ae83e0aa81 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java @@ -0,0 +1,308 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Status of the Certificate. This is set and managed automatically. */ +@ApiModel(description = "Status of the Certificate. This is set and managed automatically.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateStatus { + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public static final String SERIALIZED_NAME_LAST_FAILURE_TIME = "lastFailureTime"; + + @SerializedName(SERIALIZED_NAME_LAST_FAILURE_TIME) + private OffsetDateTime lastFailureTime; + + public static final String SERIALIZED_NAME_NEXT_PRIVATE_KEY_SECRET_NAME = + "nextPrivateKeySecretName"; + + @SerializedName(SERIALIZED_NAME_NEXT_PRIVATE_KEY_SECRET_NAME) + private String nextPrivateKeySecretName; + + public static final String SERIALIZED_NAME_NOT_AFTER = "notAfter"; + + @SerializedName(SERIALIZED_NAME_NOT_AFTER) + private OffsetDateTime notAfter; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "notBefore"; + + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + private OffsetDateTime notBefore; + + public static final String SERIALIZED_NAME_RENEWAL_TIME = "renewalTime"; + + @SerializedName(SERIALIZED_NAME_RENEWAL_TIME) + private OffsetDateTime renewalTime; + + public static final String SERIALIZED_NAME_REVISION = "revision"; + + @SerializedName(SERIALIZED_NAME_REVISION) + private Integer revision; + + public V1beta1CertificateStatus conditions(List conditions) { + + this.conditions = conditions; + return this; + } + + public V1beta1CertificateStatus addConditionsItem( + V1beta1CertificateStatusConditions conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * List of status conditions to indicate the status of certificates. Known condition types are + * `Ready` and `Issuing`. + * + * @return conditions + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`.") + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + public V1beta1CertificateStatus lastFailureTime(OffsetDateTime lastFailureTime) { + + this.lastFailureTime = lastFailureTime; + return this; + } + + /** + * LastFailureTime is the time as recorded by the Certificate controller of the most recent + * failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager + * will not re-request another Certificate until 1 hour has elapsed from this time. + * + * @return lastFailureTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time.") + public OffsetDateTime getLastFailureTime() { + return lastFailureTime; + } + + public void setLastFailureTime(OffsetDateTime lastFailureTime) { + this.lastFailureTime = lastFailureTime; + } + + public V1beta1CertificateStatus nextPrivateKeySecretName(String nextPrivateKeySecretName) { + + this.nextPrivateKeySecretName = nextPrivateKeySecretName; + return this; + } + + /** + * The name of the Secret resource containing the private key to be used for the next certificate + * iteration. The keymanager controller will automatically set this field if the + * `Issuing` condition is set to `True`. It will automatically unset this + * field when the Issuing condition is not set or False. + * + * @return nextPrivateKeySecretName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of the Secret resource containing the private key to be used for the next certificate iteration. The keymanager controller will automatically set this field if the `Issuing` condition is set to `True`. It will automatically unset this field when the Issuing condition is not set or False.") + public String getNextPrivateKeySecretName() { + return nextPrivateKeySecretName; + } + + public void setNextPrivateKeySecretName(String nextPrivateKeySecretName) { + this.nextPrivateKeySecretName = nextPrivateKeySecretName; + } + + public V1beta1CertificateStatus notAfter(OffsetDateTime notAfter) { + + this.notAfter = notAfter; + return this; + } + + /** + * The expiration time of the certificate stored in the secret named by this resource in + * `spec.secretName`. + * + * @return notAfter + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`.") + public OffsetDateTime getNotAfter() { + return notAfter; + } + + public void setNotAfter(OffsetDateTime notAfter) { + this.notAfter = notAfter; + } + + public V1beta1CertificateStatus notBefore(OffsetDateTime notBefore) { + + this.notBefore = notBefore; + return this; + } + + /** + * The time after which the certificate stored in the secret named by this resource in + * spec.secretName is valid. + * + * @return notBefore + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The time after which the certificate stored in the secret named by this resource in spec.secretName is valid.") + public OffsetDateTime getNotBefore() { + return notBefore; + } + + public void setNotBefore(OffsetDateTime notBefore) { + this.notBefore = notBefore; + } + + public V1beta1CertificateStatus renewalTime(OffsetDateTime renewalTime) { + + this.renewalTime = renewalTime; + return this; + } + + /** + * RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming + * renewal is scheduled. + * + * @return renewalTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled.") + public OffsetDateTime getRenewalTime() { + return renewalTime; + } + + public void setRenewalTime(OffsetDateTime renewalTime) { + this.renewalTime = renewalTime; + } + + public V1beta1CertificateStatus revision(Integer revision) { + + this.revision = revision; + return this; + } + + /** + * The current 'revision' of the certificate as issued. When a CertificateRequest resource + * is created, it will have the `cert-manager.io/certificate-revision` set to one + * greater than the current value of this field. Upon issuance, this field will be set to the + * value of the annotation on the CertificateRequest resource used to issue the certificate. + * Persisting the value on the CertificateRequest resource allows the certificates controller to + * know whether a request is part of an old issuance or if it is part of the ongoing + * revision's issuance by checking if the revision value in the annotation is greater than + * this field. + * + * @return revision + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The current 'revision' of the certificate as issued. When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` set to one greater than the current value of this field. Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource used to issue the certificate. Persisting the value on the CertificateRequest resource allows the certificates controller to know whether a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking if the revision value in the annotation is greater than this field.") + public Integer getRevision() { + return revision; + } + + public void setRevision(Integer revision) { + this.revision = revision; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateStatus v1beta1CertificateStatus = (V1beta1CertificateStatus) o; + return Objects.equals(this.conditions, v1beta1CertificateStatus.conditions) + && Objects.equals(this.lastFailureTime, v1beta1CertificateStatus.lastFailureTime) + && Objects.equals( + this.nextPrivateKeySecretName, v1beta1CertificateStatus.nextPrivateKeySecretName) + && Objects.equals(this.notAfter, v1beta1CertificateStatus.notAfter) + && Objects.equals(this.notBefore, v1beta1CertificateStatus.notBefore) + && Objects.equals(this.renewalTime, v1beta1CertificateStatus.renewalTime) + && Objects.equals(this.revision, v1beta1CertificateStatus.revision); + } + + @Override + public int hashCode() { + return Objects.hash( + conditions, + lastFailureTime, + nextPrivateKeySecretName, + notAfter, + notBefore, + renewalTime, + revision); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateStatus {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" lastFailureTime: ").append(toIndentedString(lastFailureTime)).append("\n"); + sb.append(" nextPrivateKeySecretName: ") + .append(toIndentedString(nextPrivateKeySecretName)) + .append("\n"); + sb.append(" notAfter: ").append(toIndentedString(notAfter)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append(" renewalTime: ").append(toIndentedString(renewalTime)).append("\n"); + sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java new file mode 100644 index 0000000000..539c169227 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java @@ -0,0 +1,263 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** CertificateCondition contains condition information for an Certificate. */ +@ApiModel(description = "CertificateCondition contains condition information for an Certificate.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1CertificateStatusConditions { + public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; + + @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) + private OffsetDateTime lastTransitionTime; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** Status of the condition, one of ('True', 'False', 'Unknown'). */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + TRUE("True"), + + FALSE("False"), + + UNKNOWN("Unknown"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public V1beta1CertificateStatusConditions lastTransitionTime(OffsetDateTime lastTransitionTime) { + + this.lastTransitionTime = lastTransitionTime; + return this; + } + + /** + * LastTransitionTime is the timestamp corresponding to the last status change of this condition. + * + * @return lastTransitionTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") + public OffsetDateTime getLastTransitionTime() { + return lastTransitionTime; + } + + public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { + this.lastTransitionTime = lastTransitionTime; + } + + public V1beta1CertificateStatusConditions message(String message) { + + this.message = message; + return this; + } + + /** + * Message is a human readable description of the details of the last transition, complementing + * reason. + * + * @return message + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Message is a human readable description of the details of the last transition, complementing reason.") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public V1beta1CertificateStatusConditions reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason is a brief machine readable explanation for the condition's last transition. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Reason is a brief machine readable explanation for the condition's last transition.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1beta1CertificateStatusConditions status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the condition, one of ('True', 'False', 'Unknown'). + * + * @return status + */ + @ApiModelProperty( + required = true, + value = "Status of the condition, one of ('True', 'False', 'Unknown').") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public V1beta1CertificateStatusConditions type(String type) { + + this.type = type; + return this; + } + + /** + * Type of the condition, known values are ('Ready', `Issuing`). + * + * @return type + */ + @ApiModelProperty( + required = true, + value = "Type of the condition, known values are ('Ready', `Issuing`).") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1CertificateStatusConditions v1beta1CertificateStatusConditions = + (V1beta1CertificateStatusConditions) o; + return Objects.equals( + this.lastTransitionTime, v1beta1CertificateStatusConditions.lastTransitionTime) + && Objects.equals(this.message, v1beta1CertificateStatusConditions.message) + && Objects.equals(this.reason, v1beta1CertificateStatusConditions.reason) + && Objects.equals(this.status, v1beta1CertificateStatusConditions.status) + && Objects.equals(this.type, v1beta1CertificateStatusConditions.type); + } + + @Override + public int hashCode() { + return Objects.hash(lastTransitionTime, message, reason, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1CertificateStatusConditions {\n"); + sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java new file mode 100644 index 0000000000..2fa64e1db0 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java @@ -0,0 +1,208 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Challenge is a type to represent a Challenge request with an ACME server */ +@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1Challenge implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1ChallengeSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1ChallengeStatus status; + + public V1beta1Challenge apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1Challenge kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1Challenge metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1Challenge spec(V1beta1ChallengeSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1ChallengeSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1ChallengeSpec spec) { + this.spec = spec; + } + + public V1beta1Challenge status(V1beta1ChallengeStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1ChallengeStatus getStatus() { + return status; + } + + public void setStatus(V1beta1ChallengeStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1Challenge v1beta1Challenge = (V1beta1Challenge) o; + return Objects.equals(this.apiVersion, v1beta1Challenge.apiVersion) + && Objects.equals(this.kind, v1beta1Challenge.kind) + && Objects.equals(this.metadata, v1beta1Challenge.metadata) + && Objects.equals(this.spec, v1beta1Challenge.spec) + && Objects.equals(this.status, v1beta1Challenge.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1Challenge {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java new file mode 100644 index 0000000000..ff0d9a04e9 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ChallengeList is a list of Challenge */ +@ApiModel(description = "ChallengeList is a list of Challenge") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1ChallengeList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1ChallengeList items(List items) { + + this.items = items; + return this; + } + + public V1beta1ChallengeList addItemsItem(V1beta1Challenge itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of challenges. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1ChallengeList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1ChallengeList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeList v1beta1ChallengeList = (V1beta1ChallengeList) o; + return Objects.equals(this.apiVersion, v1beta1ChallengeList.apiVersion) + && Objects.equals(this.items, v1beta1ChallengeList.items) + && Objects.equals(this.kind, v1beta1ChallengeList.kind) + && Objects.equals(this.metadata, v1beta1ChallengeList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java new file mode 100644 index 0000000000..419d07497c --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java @@ -0,0 +1,385 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** V1beta1ChallengeSpec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeSpec { + public static final String SERIALIZED_NAME_AUTHORIZATION_U_R_L = "authorizationURL"; + + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_U_R_L) + private String authorizationURL; + + public static final String SERIALIZED_NAME_DNS_NAME = "dnsName"; + + @SerializedName(SERIALIZED_NAME_DNS_NAME) + private String dnsName; + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1ChallengeSpecIssuerRef issuerRef; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_SOLVER = "solver"; + + @SerializedName(SERIALIZED_NAME_SOLVER) + private V1beta1ChallengeSpecSolver solver; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + /** + * The type of ACME challenge this resource represents. One of \"HTTP-01\" or + * \"DNS-01\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + HTTP_01("HTTP-01"), + + DNS_01("DNS-01"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; + + @SerializedName(SERIALIZED_NAME_WILDCARD) + private Boolean wildcard; + + public V1beta1ChallengeSpec authorizationURL(String authorizationURL) { + + this.authorizationURL = authorizationURL; + return this; + } + + /** + * The URL to the ACME Authorization resource that this challenge is a part of. + * + * @return authorizationURL + */ + @ApiModelProperty( + required = true, + value = "The URL to the ACME Authorization resource that this challenge is a part of.") + public String getAuthorizationURL() { + return authorizationURL; + } + + public void setAuthorizationURL(String authorizationURL) { + this.authorizationURL = authorizationURL; + } + + public V1beta1ChallengeSpec dnsName(String dnsName) { + + this.dnsName = dnsName; + return this; + } + + /** + * dnsName is the identifier that this challenge is for, e.g. example.com. If the requested + * DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for + * `*.example.com`, it must be `example.com`. + * + * @return dnsName + */ + @ApiModelProperty( + required = true, + value = + "dnsName is the identifier that this challenge is for, e.g. example.com. If the requested DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for `*.example.com`, it must be `example.com`.") + public String getDnsName() { + return dnsName; + } + + public void setDnsName(String dnsName) { + this.dnsName = dnsName; + } + + public V1beta1ChallengeSpec issuerRef(V1beta1ChallengeSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1ChallengeSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1ChallengeSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1beta1ChallengeSpec key(String key) { + + this.key = key; + return this; + } + + /** + * The ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be + * responded with to complete the HTTP01 challenge in the format: `<private key JWK + * thumbprint>.<key from acme server for challenge>`. For DNS01 challenges, this is + * the base64 encoded SHA256 sum of the `<private key JWK thumbprint>.<key from acme + * server for challenge>` text that must be set as the TXT record content. + * + * @return key + */ + @ApiModelProperty( + required = true, + value = + "The ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be responded with to complete the HTTP01 challenge in the format: `.`. For DNS01 challenges, this is the base64 encoded SHA256 sum of the `.` text that must be set as the TXT record content.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public V1beta1ChallengeSpec solver(V1beta1ChallengeSpecSolver solver) { + + this.solver = solver; + return this; + } + + /** + * Get solver + * + * @return solver + */ + @ApiModelProperty(required = true, value = "") + public V1beta1ChallengeSpecSolver getSolver() { + return solver; + } + + public void setSolver(V1beta1ChallengeSpecSolver solver) { + this.solver = solver; + } + + public V1beta1ChallengeSpec token(String token) { + + this.token = token; + return this; + } + + /** + * The ACME challenge token for this challenge. This is the raw value returned from the ACME + * server. + * + * @return token + */ + @ApiModelProperty( + required = true, + value = + "The ACME challenge token for this challenge. This is the raw value returned from the ACME server.") + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public V1beta1ChallengeSpec type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of ACME challenge this resource represents. One of \"HTTP-01\" or + * \"DNS-01\". + * + * @return type + */ + @ApiModelProperty( + required = true, + value = + "The type of ACME challenge this resource represents. One of \"HTTP-01\" or \"DNS-01\".") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public V1beta1ChallengeSpec url(String url) { + + this.url = url; + return this; + } + + /** + * The URL of the ACME Challenge resource for this challenge. This can be used to lookup details + * about the status of this challenge. + * + * @return url + */ + @ApiModelProperty( + required = true, + value = + "The URL of the ACME Challenge resource for this challenge. This can be used to lookup details about the status of this challenge.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public V1beta1ChallengeSpec wildcard(Boolean wildcard) { + + this.wildcard = wildcard; + return this; + } + + /** + * wildcard will be true if this challenge is for a wildcard identifier, for example + * '*.example.com'. + * + * @return wildcard + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "wildcard will be true if this challenge is for a wildcard identifier, for example '*.example.com'.") + public Boolean getWildcard() { + return wildcard; + } + + public void setWildcard(Boolean wildcard) { + this.wildcard = wildcard; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeSpec v1beta1ChallengeSpec = (V1beta1ChallengeSpec) o; + return Objects.equals(this.authorizationURL, v1beta1ChallengeSpec.authorizationURL) + && Objects.equals(this.dnsName, v1beta1ChallengeSpec.dnsName) + && Objects.equals(this.issuerRef, v1beta1ChallengeSpec.issuerRef) + && Objects.equals(this.key, v1beta1ChallengeSpec.key) + && Objects.equals(this.solver, v1beta1ChallengeSpec.solver) + && Objects.equals(this.token, v1beta1ChallengeSpec.token) + && Objects.equals(this.type, v1beta1ChallengeSpec.type) + && Objects.equals(this.url, v1beta1ChallengeSpec.url) + && Objects.equals(this.wildcard, v1beta1ChallengeSpec.wildcard); + } + + @Override + public int hashCode() { + return Objects.hash( + authorizationURL, dnsName, issuerRef, key, solver, token, type, url, wildcard); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeSpec {\n"); + sb.append(" authorizationURL: ").append(toIndentedString(authorizationURL)).append("\n"); + sb.append(" dnsName: ").append(toIndentedString(dnsName)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" solver: ").append(toIndentedString(solver)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java new file mode 100644 index 0000000000..f1d66ecfd2 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java @@ -0,0 +1,148 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * References a properly configured ACME-type Issuer which should be used to create this Challenge. + * If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' + * Issuer, an error will be returned and the Challenge will be marked as failed. + */ +@ApiModel( + description = + "References a properly configured ACME-type Issuer which should be used to create this Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeSpecIssuerRef { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1ChallengeSpecIssuerRef group(String group) { + + this.group = group; + return this; + } + + /** + * Group of the resource being referred to. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group of the resource being referred to.") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1beta1ChallengeSpecIssuerRef kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind of the resource being referred to. + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind of the resource being referred to.") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1ChallengeSpecIssuerRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of the resource being referred to.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeSpecIssuerRef v1beta1ChallengeSpecIssuerRef = (V1beta1ChallengeSpecIssuerRef) o; + return Objects.equals(this.group, v1beta1ChallengeSpecIssuerRef.group) + && Objects.equals(this.kind, v1beta1ChallengeSpecIssuerRef.kind) + && Objects.equals(this.name, v1beta1ChallengeSpecIssuerRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(group, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeSpecIssuerRef {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java new file mode 100644 index 0000000000..968a80e880 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Contains the domain solving configuration that should be used to solve this challenge resource. + */ +@ApiModel( + description = + "Contains the domain solving configuration that should be used to solve this challenge resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeSpecSolver { + public static final String SERIALIZED_NAME_DNS01 = "dns01"; + + @SerializedName(SERIALIZED_NAME_DNS01) + private V1beta1ChallengeSpecSolverDns01 dns01; + + public static final String SERIALIZED_NAME_HTTP01 = "http01"; + + @SerializedName(SERIALIZED_NAME_HTTP01) + private V1alpha2IssuerSpecAcmeHttp01 http01; + + public static final String SERIALIZED_NAME_SELECTOR = "selector"; + + @SerializedName(SERIALIZED_NAME_SELECTOR) + private V1alpha2IssuerSpecAcmeSelector selector; + + public V1beta1ChallengeSpecSolver dns01(V1beta1ChallengeSpecSolverDns01 dns01) { + + this.dns01 = dns01; + return this; + } + + /** + * Get dns01 + * + * @return dns01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1ChallengeSpecSolverDns01 getDns01() { + return dns01; + } + + public void setDns01(V1beta1ChallengeSpecSolverDns01 dns01) { + this.dns01 = dns01; + } + + public V1beta1ChallengeSpecSolver http01(V1alpha2IssuerSpecAcmeHttp01 http01) { + + this.http01 = http01; + return this; + } + + /** + * Get http01 + * + * @return http01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { + return http01; + } + + public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { + this.http01 = http01; + } + + public V1beta1ChallengeSpecSolver selector(V1alpha2IssuerSpecAcmeSelector selector) { + + this.selector = selector; + return this; + } + + /** + * Get selector + * + * @return selector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeSelector getSelector() { + return selector; + } + + public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { + this.selector = selector; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeSpecSolver v1beta1ChallengeSpecSolver = (V1beta1ChallengeSpecSolver) o; + return Objects.equals(this.dns01, v1beta1ChallengeSpecSolver.dns01) + && Objects.equals(this.http01, v1beta1ChallengeSpecSolver.http01) + && Objects.equals(this.selector, v1beta1ChallengeSpecSolver.selector); + } + + @Override + public int hashCode() { + return Objects.hash(dns01, http01, selector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeSpecSolver {\n"); + sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); + sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); + sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java new file mode 100644 index 0000000000..764ee818a7 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java @@ -0,0 +1,414 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** + * Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge + * flow. + */ +@ApiModel( + description = + "Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge flow.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeSpecSolverDns01 { + public static final String SERIALIZED_NAME_ACME_D_N_S = "acmeDNS"; + + @SerializedName(SERIALIZED_NAME_ACME_D_N_S) + private V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS; + + public static final String SERIALIZED_NAME_AKAMAI = "akamai"; + + @SerializedName(SERIALIZED_NAME_AKAMAI) + private V1alpha2IssuerSpecAcmeDns01Akamai akamai; + + public static final String SERIALIZED_NAME_AZURE_D_N_S = "azureDNS"; + + @SerializedName(SERIALIZED_NAME_AZURE_D_N_S) + private V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS; + + public static final String SERIALIZED_NAME_CLOUD_D_N_S = "cloudDNS"; + + @SerializedName(SERIALIZED_NAME_CLOUD_D_N_S) + private V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS; + + public static final String SERIALIZED_NAME_CLOUDFLARE = "cloudflare"; + + @SerializedName(SERIALIZED_NAME_CLOUDFLARE) + private V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare; + + /** + * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS + * zones. + */ + @JsonAdapter(CnameStrategyEnum.Adapter.class) + public enum CnameStrategyEnum { + NONE("None"), + + FOLLOW("Follow"); + + private String value; + + CnameStrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CnameStrategyEnum fromValue(String value) { + for (CnameStrategyEnum b : CnameStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CnameStrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CnameStrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CnameStrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CNAME_STRATEGY = "cnameStrategy"; + + @SerializedName(SERIALIZED_NAME_CNAME_STRATEGY) + private CnameStrategyEnum cnameStrategy; + + public static final String SERIALIZED_NAME_DIGITALOCEAN = "digitalocean"; + + @SerializedName(SERIALIZED_NAME_DIGITALOCEAN) + private V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean; + + public static final String SERIALIZED_NAME_RFC2136 = "rfc2136"; + + @SerializedName(SERIALIZED_NAME_RFC2136) + private V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136; + + public static final String SERIALIZED_NAME_ROUTE53 = "route53"; + + @SerializedName(SERIALIZED_NAME_ROUTE53) + private V1alpha2IssuerSpecAcmeDns01Route53 route53; + + public static final String SERIALIZED_NAME_WEBHOOK = "webhook"; + + @SerializedName(SERIALIZED_NAME_WEBHOOK) + private V1alpha2IssuerSpecAcmeDns01Webhook webhook; + + public V1beta1ChallengeSpecSolverDns01 acmeDNS(V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS) { + + this.acmeDNS = acmeDNS; + return this; + } + + /** + * Get acmeDNS + * + * @return acmeDNS + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Acmedns getAcmeDNS() { + return acmeDNS; + } + + public void setAcmeDNS(V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS) { + this.acmeDNS = acmeDNS; + } + + public V1beta1ChallengeSpecSolverDns01 akamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { + + this.akamai = akamai; + return this; + } + + /** + * Get akamai + * + * @return akamai + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Akamai getAkamai() { + return akamai; + } + + public void setAkamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { + this.akamai = akamai; + } + + public V1beta1ChallengeSpecSolverDns01 azureDNS(V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS) { + + this.azureDNS = azureDNS; + return this; + } + + /** + * Get azureDNS + * + * @return azureDNS + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Azuredns getAzureDNS() { + return azureDNS; + } + + public void setAzureDNS(V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS) { + this.azureDNS = azureDNS; + } + + public V1beta1ChallengeSpecSolverDns01 cloudDNS(V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS) { + + this.cloudDNS = cloudDNS; + return this; + } + + /** + * Get cloudDNS + * + * @return cloudDNS + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Clouddns getCloudDNS() { + return cloudDNS; + } + + public void setCloudDNS(V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS) { + this.cloudDNS = cloudDNS; + } + + public V1beta1ChallengeSpecSolverDns01 cloudflare( + V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { + + this.cloudflare = cloudflare; + return this; + } + + /** + * Get cloudflare + * + * @return cloudflare + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Cloudflare getCloudflare() { + return cloudflare; + } + + public void setCloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { + this.cloudflare = cloudflare; + } + + public V1beta1ChallengeSpecSolverDns01 cnameStrategy(CnameStrategyEnum cnameStrategy) { + + this.cnameStrategy = cnameStrategy; + return this; + } + + /** + * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS + * zones. + * + * @return cnameStrategy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS zones.") + public CnameStrategyEnum getCnameStrategy() { + return cnameStrategy; + } + + public void setCnameStrategy(CnameStrategyEnum cnameStrategy) { + this.cnameStrategy = cnameStrategy; + } + + public V1beta1ChallengeSpecSolverDns01 digitalocean( + V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { + + this.digitalocean = digitalocean; + return this; + } + + /** + * Get digitalocean + * + * @return digitalocean + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Digitalocean getDigitalocean() { + return digitalocean; + } + + public void setDigitalocean(V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { + this.digitalocean = digitalocean; + } + + public V1beta1ChallengeSpecSolverDns01 rfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { + + this.rfc2136 = rfc2136; + return this; + } + + /** + * Get rfc2136 + * + * @return rfc2136 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Rfc2136 getRfc2136() { + return rfc2136; + } + + public void setRfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { + this.rfc2136 = rfc2136; + } + + public V1beta1ChallengeSpecSolverDns01 route53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { + + this.route53 = route53; + return this; + } + + /** + * Get route53 + * + * @return route53 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Route53 getRoute53() { + return route53; + } + + public void setRoute53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { + this.route53 = route53; + } + + public V1beta1ChallengeSpecSolverDns01 webhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { + + this.webhook = webhook; + return this; + } + + /** + * Get webhook + * + * @return webhook + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeDns01Webhook getWebhook() { + return webhook; + } + + public void setWebhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { + this.webhook = webhook; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeSpecSolverDns01 v1beta1ChallengeSpecSolverDns01 = + (V1beta1ChallengeSpecSolverDns01) o; + return Objects.equals(this.acmeDNS, v1beta1ChallengeSpecSolverDns01.acmeDNS) + && Objects.equals(this.akamai, v1beta1ChallengeSpecSolverDns01.akamai) + && Objects.equals(this.azureDNS, v1beta1ChallengeSpecSolverDns01.azureDNS) + && Objects.equals(this.cloudDNS, v1beta1ChallengeSpecSolverDns01.cloudDNS) + && Objects.equals(this.cloudflare, v1beta1ChallengeSpecSolverDns01.cloudflare) + && Objects.equals(this.cnameStrategy, v1beta1ChallengeSpecSolverDns01.cnameStrategy) + && Objects.equals(this.digitalocean, v1beta1ChallengeSpecSolverDns01.digitalocean) + && Objects.equals(this.rfc2136, v1beta1ChallengeSpecSolverDns01.rfc2136) + && Objects.equals(this.route53, v1beta1ChallengeSpecSolverDns01.route53) + && Objects.equals(this.webhook, v1beta1ChallengeSpecSolverDns01.webhook); + } + + @Override + public int hashCode() { + return Objects.hash( + acmeDNS, + akamai, + azureDNS, + cloudDNS, + cloudflare, + cnameStrategy, + digitalocean, + rfc2136, + route53, + webhook); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeSpecSolverDns01 {\n"); + sb.append(" acmeDNS: ").append(toIndentedString(acmeDNS)).append("\n"); + sb.append(" akamai: ").append(toIndentedString(akamai)).append("\n"); + sb.append(" azureDNS: ").append(toIndentedString(azureDNS)).append("\n"); + sb.append(" cloudDNS: ").append(toIndentedString(cloudDNS)).append("\n"); + sb.append(" cloudflare: ").append(toIndentedString(cloudflare)).append("\n"); + sb.append(" cnameStrategy: ").append(toIndentedString(cnameStrategy)).append("\n"); + sb.append(" digitalocean: ").append(toIndentedString(digitalocean)).append("\n"); + sb.append(" rfc2136: ").append(toIndentedString(rfc2136)).append("\n"); + sb.append(" route53: ").append(toIndentedString(route53)).append("\n"); + sb.append(" webhook: ").append(toIndentedString(webhook)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java new file mode 100644 index 0000000000..0ff107d7db --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java @@ -0,0 +1,247 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Objects; + +/** V1beta1ChallengeStatus */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ChallengeStatus { + public static final String SERIALIZED_NAME_PRESENTED = "presented"; + + @SerializedName(SERIALIZED_NAME_PRESENTED) + private Boolean presented; + + public static final String SERIALIZED_NAME_PROCESSING = "processing"; + + @SerializedName(SERIALIZED_NAME_PROCESSING) + private Boolean processing; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** + * Contains the current 'state' of the challenge. If not set, the state of the challenge + * is unknown. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + VALID("valid"), + + READY("ready"), + + PENDING("pending"), + + PROCESSING("processing"), + + INVALID("invalid"), + + EXPIRED("expired"), + + ERRORED("errored"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public V1beta1ChallengeStatus presented(Boolean presented) { + + this.presented = presented; + return this; + } + + /** + * presented will be set to true if the challenge values for this challenge are currently + * 'presented'. This *does not* imply the self check is passing. Only that the values have + * been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has + * been presented, or the HTTP01 configuration has been configured). + * + * @return presented + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "presented will be set to true if the challenge values for this challenge are currently 'presented'. This *does not* imply the self check is passing. Only that the values have been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has been presented, or the HTTP01 configuration has been configured).") + public Boolean getPresented() { + return presented; + } + + public void setPresented(Boolean presented) { + this.presented = presented; + } + + public V1beta1ChallengeStatus processing(Boolean processing) { + + this.processing = processing; + return this; + } + + /** + * Used to denote whether this challenge should be processed or not. This field will only be set + * to true by the 'scheduling' component. It will only be set to false by the + * 'challenges' controller, after the challenge has reached a final state or timed out. If + * this field is set to false, the challenge controller will not take any more action. + * + * @return processing + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Used to denote whether this challenge should be processed or not. This field will only be set to true by the 'scheduling' component. It will only be set to false by the 'challenges' controller, after the challenge has reached a final state or timed out. If this field is set to false, the challenge controller will not take any more action.") + public Boolean getProcessing() { + return processing; + } + + public void setProcessing(Boolean processing) { + this.processing = processing; + } + + public V1beta1ChallengeStatus reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Contains human readable information on why the Challenge is in the current state. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Contains human readable information on why the Challenge is in the current state.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1beta1ChallengeStatus state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * Contains the current 'state' of the challenge. If not set, the state of the challenge + * is unknown. + * + * @return state + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Contains the current 'state' of the challenge. If not set, the state of the challenge is unknown.") + public StateEnum getState() { + return state; + } + + public void setState(StateEnum state) { + this.state = state; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ChallengeStatus v1beta1ChallengeStatus = (V1beta1ChallengeStatus) o; + return Objects.equals(this.presented, v1beta1ChallengeStatus.presented) + && Objects.equals(this.processing, v1beta1ChallengeStatus.processing) + && Objects.equals(this.reason, v1beta1ChallengeStatus.reason) + && Objects.equals(this.state, v1beta1ChallengeStatus.state); + } + + @Override + public int hashCode() { + return Objects.hash(presented, processing, reason, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ChallengeStatus {\n"); + sb.append(" presented: ").append(toIndentedString(presented)).append("\n"); + sb.append(" processing: ").append(toIndentedString(processing)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java new file mode 100644 index 0000000000..bf21ddf0aa --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java @@ -0,0 +1,216 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and + * therefore can be referenced by resources that exist in *any* namespace, not just the same + * namespace as the referent. + */ +@ApiModel( + description = + "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1ClusterIssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha3ClusterIssuerStatus status; + + public V1beta1ClusterIssuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1ClusterIssuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1ClusterIssuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1ClusterIssuer spec(V1beta1ClusterIssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1ClusterIssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1ClusterIssuerSpec spec) { + this.spec = spec; + } + + public V1beta1ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha3ClusterIssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha3ClusterIssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ClusterIssuer v1beta1ClusterIssuer = (V1beta1ClusterIssuer) o; + return Objects.equals(this.apiVersion, v1beta1ClusterIssuer.apiVersion) + && Objects.equals(this.kind, v1beta1ClusterIssuer.kind) + && Objects.equals(this.metadata, v1beta1ClusterIssuer.metadata) + && Objects.equals(this.spec, v1beta1ClusterIssuer.spec) + && Objects.equals(this.status, v1beta1ClusterIssuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ClusterIssuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java new file mode 100644 index 0000000000..86b3c10195 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** ClusterIssuerList is a list of ClusterIssuer */ +@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1ClusterIssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1ClusterIssuerList items(List items) { + + this.items = items; + return this; + } + + public V1beta1ClusterIssuerList addItemsItem(V1beta1ClusterIssuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of clusterissuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1ClusterIssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1ClusterIssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ClusterIssuerList v1beta1ClusterIssuerList = (V1beta1ClusterIssuerList) o; + return Objects.equals(this.apiVersion, v1beta1ClusterIssuerList.apiVersion) + && Objects.equals(this.items, v1beta1ClusterIssuerList.items) + && Objects.equals(this.kind, v1beta1ClusterIssuerList.kind) + && Objects.equals(this.metadata, v1beta1ClusterIssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ClusterIssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java new file mode 100644 index 0000000000..04c1c349b3 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java @@ -0,0 +1,199 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Desired state of the ClusterIssuer resource. */ +@ApiModel(description = "Desired state of the ClusterIssuer resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1ClusterIssuerSpec { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1beta1IssuerSpecAcme acme; + + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1alpha2IssuerSpecCa ca; + + public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; + + @SerializedName(SERIALIZED_NAME_SELF_SIGNED) + private V1alpha2IssuerSpecSelfSigned selfSigned; + + public static final String SERIALIZED_NAME_VAULT = "vault"; + + @SerializedName(SERIALIZED_NAME_VAULT) + private V1alpha2IssuerSpecVault vault; + + public static final String SERIALIZED_NAME_VENAFI = "venafi"; + + @SerializedName(SERIALIZED_NAME_VENAFI) + private V1alpha2IssuerSpecVenafi venafi; + + public V1beta1ClusterIssuerSpec acme(V1beta1IssuerSpecAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1IssuerSpecAcme getAcme() { + return acme; + } + + public void setAcme(V1beta1IssuerSpecAcme acme) { + this.acme = acme; + } + + public V1beta1ClusterIssuerSpec ca(V1alpha2IssuerSpecCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecCa getCa() { + return ca; + } + + public void setCa(V1alpha2IssuerSpecCa ca) { + this.ca = ca; + } + + public V1beta1ClusterIssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + + this.selfSigned = selfSigned; + return this; + } + + /** + * Get selfSigned + * + * @return selfSigned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecSelfSigned getSelfSigned() { + return selfSigned; + } + + public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + this.selfSigned = selfSigned; + } + + public V1beta1ClusterIssuerSpec vault(V1alpha2IssuerSpecVault vault) { + + this.vault = vault; + return this; + } + + /** + * Get vault + * + * @return vault + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVault getVault() { + return vault; + } + + public void setVault(V1alpha2IssuerSpecVault vault) { + this.vault = vault; + } + + public V1beta1ClusterIssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { + + this.venafi = venafi; + return this; + } + + /** + * Get venafi + * + * @return venafi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafi getVenafi() { + return venafi; + } + + public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { + this.venafi = venafi; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1ClusterIssuerSpec v1beta1ClusterIssuerSpec = (V1beta1ClusterIssuerSpec) o; + return Objects.equals(this.acme, v1beta1ClusterIssuerSpec.acme) + && Objects.equals(this.ca, v1beta1ClusterIssuerSpec.ca) + && Objects.equals(this.selfSigned, v1beta1ClusterIssuerSpec.selfSigned) + && Objects.equals(this.vault, v1beta1ClusterIssuerSpec.vault) + && Objects.equals(this.venafi, v1beta1ClusterIssuerSpec.venafi); + } + + @Override + public int hashCode() { + return Objects.hash(acme, ca, selfSigned, vault, venafi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1ClusterIssuerSpec {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); + sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); + sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java new file mode 100644 index 0000000000..76c39656c0 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java @@ -0,0 +1,215 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * An Issuer represents a certificate issuing authority which can be referenced as part of + * `issuerRef` fields. It is scoped to a single namespace and can therefore only be + * referenced by resources within the same namespace. + */ +@ApiModel( + description = + "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1Issuer implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1IssuerSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha2IssuerStatus status; + + public V1beta1Issuer apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1Issuer kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1Issuer metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1Issuer spec(V1beta1IssuerSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1IssuerSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1IssuerSpec spec) { + this.spec = spec; + } + + public V1beta1Issuer status(V1alpha2IssuerStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerStatus getStatus() { + return status; + } + + public void setStatus(V1alpha2IssuerStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1Issuer v1beta1Issuer = (V1beta1Issuer) o; + return Objects.equals(this.apiVersion, v1beta1Issuer.apiVersion) + && Objects.equals(this.kind, v1beta1Issuer.kind) + && Objects.equals(this.metadata, v1beta1Issuer.metadata) + && Objects.equals(this.spec, v1beta1Issuer.spec) + && Objects.equals(this.status, v1beta1Issuer.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1Issuer {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java new file mode 100644 index 0000000000..6fc652ddff --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** IssuerList is a list of Issuer */ +@ApiModel(description = "IssuerList is a list of Issuer") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1IssuerList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1IssuerList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1IssuerList items(List items) { + + this.items = items; + return this; + } + + public V1beta1IssuerList addItemsItem(V1beta1Issuer itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of issuers. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1IssuerList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1IssuerList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1IssuerList v1beta1IssuerList = (V1beta1IssuerList) o; + return Objects.equals(this.apiVersion, v1beta1IssuerList.apiVersion) + && Objects.equals(this.items, v1beta1IssuerList.items) + && Objects.equals(this.kind, v1beta1IssuerList.kind) + && Objects.equals(this.metadata, v1beta1IssuerList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1IssuerList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java new file mode 100644 index 0000000000..610ee2772c --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java @@ -0,0 +1,199 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Desired state of the Issuer resource. */ +@ApiModel(description = "Desired state of the Issuer resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1IssuerSpec { + public static final String SERIALIZED_NAME_ACME = "acme"; + + @SerializedName(SERIALIZED_NAME_ACME) + private V1beta1IssuerSpecAcme acme; + + public static final String SERIALIZED_NAME_CA = "ca"; + + @SerializedName(SERIALIZED_NAME_CA) + private V1alpha2IssuerSpecCa ca; + + public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; + + @SerializedName(SERIALIZED_NAME_SELF_SIGNED) + private V1alpha2IssuerSpecSelfSigned selfSigned; + + public static final String SERIALIZED_NAME_VAULT = "vault"; + + @SerializedName(SERIALIZED_NAME_VAULT) + private V1alpha2IssuerSpecVault vault; + + public static final String SERIALIZED_NAME_VENAFI = "venafi"; + + @SerializedName(SERIALIZED_NAME_VENAFI) + private V1alpha2IssuerSpecVenafi venafi; + + public V1beta1IssuerSpec acme(V1beta1IssuerSpecAcme acme) { + + this.acme = acme; + return this; + } + + /** + * Get acme + * + * @return acme + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1IssuerSpecAcme getAcme() { + return acme; + } + + public void setAcme(V1beta1IssuerSpecAcme acme) { + this.acme = acme; + } + + public V1beta1IssuerSpec ca(V1alpha2IssuerSpecCa ca) { + + this.ca = ca; + return this; + } + + /** + * Get ca + * + * @return ca + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecCa getCa() { + return ca; + } + + public void setCa(V1alpha2IssuerSpecCa ca) { + this.ca = ca; + } + + public V1beta1IssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + + this.selfSigned = selfSigned; + return this; + } + + /** + * Get selfSigned + * + * @return selfSigned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecSelfSigned getSelfSigned() { + return selfSigned; + } + + public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { + this.selfSigned = selfSigned; + } + + public V1beta1IssuerSpec vault(V1alpha2IssuerSpecVault vault) { + + this.vault = vault; + return this; + } + + /** + * Get vault + * + * @return vault + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVault getVault() { + return vault; + } + + public void setVault(V1alpha2IssuerSpecVault vault) { + this.vault = vault; + } + + public V1beta1IssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { + + this.venafi = venafi; + return this; + } + + /** + * Get venafi + * + * @return venafi + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecVenafi getVenafi() { + return venafi; + } + + public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { + this.venafi = venafi; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1IssuerSpec v1beta1IssuerSpec = (V1beta1IssuerSpec) o; + return Objects.equals(this.acme, v1beta1IssuerSpec.acme) + && Objects.equals(this.ca, v1beta1IssuerSpec.ca) + && Objects.equals(this.selfSigned, v1beta1IssuerSpec.selfSigned) + && Objects.equals(this.vault, v1beta1IssuerSpec.vault) + && Objects.equals(this.venafi, v1beta1IssuerSpec.venafi); + } + + @Override + public int hashCode() { + return Objects.hash(acme, ca, selfSigned, vault, venafi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1IssuerSpec {\n"); + sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); + sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); + sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); + sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); + sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java new file mode 100644 index 0000000000..2a7b358d7b --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java @@ -0,0 +1,270 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 + * certificates. + */ +@ApiModel( + description = + "ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 certificates.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1IssuerSpecAcme { + public static final String SERIALIZED_NAME_EMAIL = "email"; + + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING = "externalAccountBinding"; + + @SerializedName(SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING) + private V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding; + + public static final String SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF = "privateKeySecretRef"; + + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF) + private V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef; + + public static final String SERIALIZED_NAME_SERVER = "server"; + + @SerializedName(SERIALIZED_NAME_SERVER) + private String server; + + public static final String SERIALIZED_NAME_SKIP_T_L_S_VERIFY = "skipTLSVerify"; + + @SerializedName(SERIALIZED_NAME_SKIP_T_L_S_VERIFY) + private Boolean skipTLSVerify; + + public static final String SERIALIZED_NAME_SOLVERS = "solvers"; + + @SerializedName(SERIALIZED_NAME_SOLVERS) + private List solvers = null; + + public V1beta1IssuerSpecAcme email(String email) { + + this.email = email; + return this; + } + + /** + * Email is the email address to be associated with the ACME account. This field is optional, but + * it is strongly recommended to be set. It will be used to contact you in case of issues with + * your account or certificates, including expiry notification emails. This field may be updated + * after the account is initially registered. + * + * @return email + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Email is the email address to be associated with the ACME account. This field is optional, but it is strongly recommended to be set. It will be used to contact you in case of issues with your account or certificates, including expiry notification emails. This field may be updated after the account is initially registered.") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public V1beta1IssuerSpecAcme externalAccountBinding( + V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { + + this.externalAccountBinding = externalAccountBinding; + return this; + } + + /** + * Get externalAccountBinding + * + * @return externalAccountBinding + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeExternalAccountBinding getExternalAccountBinding() { + return externalAccountBinding; + } + + public void setExternalAccountBinding( + V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { + this.externalAccountBinding = externalAccountBinding; + } + + public V1beta1IssuerSpecAcme privateKeySecretRef( + V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { + + this.privateKeySecretRef = privateKeySecretRef; + return this; + } + + /** + * Get privateKeySecretRef + * + * @return privateKeySecretRef + */ + @ApiModelProperty(required = true, value = "") + public V1alpha2IssuerSpecAcmePrivateKeySecretRef getPrivateKeySecretRef() { + return privateKeySecretRef; + } + + public void setPrivateKeySecretRef( + V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { + this.privateKeySecretRef = privateKeySecretRef; + } + + public V1beta1IssuerSpecAcme server(String server) { + + this.server = server; + return this; + } + + /** + * Server is the URL used to access the ACME server's 'directory' endpoint. For + * example, for Let's Encrypt's staging endpoint, you would use: + * \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints + * (i.e. RFC 8555) are supported. + * + * @return server + */ + @ApiModelProperty( + required = true, + value = + "Server is the URL used to access the ACME server's 'directory' endpoint. For example, for Let's Encrypt's staging endpoint, you would use: \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints (i.e. RFC 8555) are supported.") + public String getServer() { + return server; + } + + public void setServer(String server) { + this.server = server; + } + + public V1beta1IssuerSpecAcme skipTLSVerify(Boolean skipTLSVerify) { + + this.skipTLSVerify = skipTLSVerify; + return this; + } + + /** + * Enables or disables validation of the ACME server TLS certificate. If true, requests to the + * ACME server will not have their TLS certificate validated (i.e. insecure connections will be + * allowed). Only enable this option in development environments. The cert-manager system + * installed roots will be used to verify connections to the ACME server if this is false. + * Defaults to false. + * + * @return skipTLSVerify + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enables or disables validation of the ACME server TLS certificate. If true, requests to the ACME server will not have their TLS certificate validated (i.e. insecure connections will be allowed). Only enable this option in development environments. The cert-manager system installed roots will be used to verify connections to the ACME server if this is false. Defaults to false.") + public Boolean getSkipTLSVerify() { + return skipTLSVerify; + } + + public void setSkipTLSVerify(Boolean skipTLSVerify) { + this.skipTLSVerify = skipTLSVerify; + } + + public V1beta1IssuerSpecAcme solvers(List solvers) { + + this.solvers = solvers; + return this; + } + + public V1beta1IssuerSpecAcme addSolversItem(V1beta1IssuerSpecAcmeSolvers solversItem) { + if (this.solvers == null) { + this.solvers = new ArrayList(); + } + this.solvers.add(solversItem); + return this; + } + + /** + * Solvers is a list of challenge solvers that will be used to solve ACME challenges for the + * matching domains. Solver configurations must be provided in order to obtain certificates from + * an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/ + * + * @return solvers + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Solvers is a list of challenge solvers that will be used to solve ACME challenges for the matching domains. Solver configurations must be provided in order to obtain certificates from an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/") + public List getSolvers() { + return solvers; + } + + public void setSolvers(List solvers) { + this.solvers = solvers; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1IssuerSpecAcme v1beta1IssuerSpecAcme = (V1beta1IssuerSpecAcme) o; + return Objects.equals(this.email, v1beta1IssuerSpecAcme.email) + && Objects.equals(this.externalAccountBinding, v1beta1IssuerSpecAcme.externalAccountBinding) + && Objects.equals(this.privateKeySecretRef, v1beta1IssuerSpecAcme.privateKeySecretRef) + && Objects.equals(this.server, v1beta1IssuerSpecAcme.server) + && Objects.equals(this.skipTLSVerify, v1beta1IssuerSpecAcme.skipTLSVerify) + && Objects.equals(this.solvers, v1beta1IssuerSpecAcme.solvers); + } + + @Override + public int hashCode() { + return Objects.hash( + email, externalAccountBinding, privateKeySecretRef, server, skipTLSVerify, solvers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1IssuerSpecAcme {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" externalAccountBinding: ") + .append(toIndentedString(externalAccountBinding)) + .append("\n"); + sb.append(" privateKeySecretRef: ") + .append(toIndentedString(privateKeySecretRef)) + .append("\n"); + sb.append(" server: ").append(toIndentedString(server)).append("\n"); + sb.append(" skipTLSVerify: ").append(toIndentedString(skipTLSVerify)).append("\n"); + sb.append(" solvers: ").append(toIndentedString(solvers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java new file mode 100644 index 0000000000..247b6ffc26 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java @@ -0,0 +1,148 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 + * may be provided. + */ +@ApiModel( + description = + "Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 may be provided.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1IssuerSpecAcmeSolvers { + public static final String SERIALIZED_NAME_DNS01 = "dns01"; + + @SerializedName(SERIALIZED_NAME_DNS01) + private V1beta1ChallengeSpecSolverDns01 dns01; + + public static final String SERIALIZED_NAME_HTTP01 = "http01"; + + @SerializedName(SERIALIZED_NAME_HTTP01) + private V1alpha2IssuerSpecAcmeHttp01 http01; + + public static final String SERIALIZED_NAME_SELECTOR = "selector"; + + @SerializedName(SERIALIZED_NAME_SELECTOR) + private V1alpha2IssuerSpecAcmeSelector selector; + + public V1beta1IssuerSpecAcmeSolvers dns01(V1beta1ChallengeSpecSolverDns01 dns01) { + + this.dns01 = dns01; + return this; + } + + /** + * Get dns01 + * + * @return dns01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1ChallengeSpecSolverDns01 getDns01() { + return dns01; + } + + public void setDns01(V1beta1ChallengeSpecSolverDns01 dns01) { + this.dns01 = dns01; + } + + public V1beta1IssuerSpecAcmeSolvers http01(V1alpha2IssuerSpecAcmeHttp01 http01) { + + this.http01 = http01; + return this; + } + + /** + * Get http01 + * + * @return http01 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { + return http01; + } + + public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { + this.http01 = http01; + } + + public V1beta1IssuerSpecAcmeSolvers selector(V1alpha2IssuerSpecAcmeSelector selector) { + + this.selector = selector; + return this; + } + + /** + * Get selector + * + * @return selector + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1alpha2IssuerSpecAcmeSelector getSelector() { + return selector; + } + + public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { + this.selector = selector; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1IssuerSpecAcmeSolvers v1beta1IssuerSpecAcmeSolvers = (V1beta1IssuerSpecAcmeSolvers) o; + return Objects.equals(this.dns01, v1beta1IssuerSpecAcmeSolvers.dns01) + && Objects.equals(this.http01, v1beta1IssuerSpecAcmeSolvers.http01) + && Objects.equals(this.selector, v1beta1IssuerSpecAcmeSolvers.selector); + } + + @Override + public int hashCode() { + return Objects.hash(dns01, http01, selector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1IssuerSpecAcmeSolvers {\n"); + sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); + sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); + sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java new file mode 100644 index 0000000000..01d5a86471 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java @@ -0,0 +1,208 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** Order is a type to represent an Order with an ACME server */ +@ApiModel(description = "Order is a type to represent an Order with an ACME server") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1Order implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private V1beta1OrderSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private V1beta1OrderStatus status; + + public V1beta1Order apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1Order kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1Order metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @ApiModelProperty(required = true, value = "") + public V1ObjectMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + public V1beta1Order spec(V1beta1OrderSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * + * @return spec + */ + @ApiModelProperty(required = true, value = "") + public V1beta1OrderSpec getSpec() { + return spec; + } + + public void setSpec(V1beta1OrderSpec spec) { + this.spec = spec; + } + + public V1beta1Order status(V1beta1OrderStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1beta1OrderStatus getStatus() { + return status; + } + + public void setStatus(V1beta1OrderStatus status) { + this.status = status; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1Order v1beta1Order = (V1beta1Order) o; + return Objects.equals(this.apiVersion, v1beta1Order.apiVersion) + && Objects.equals(this.kind, v1beta1Order.kind) + && Objects.equals(this.metadata, v1beta1Order.metadata) + && Objects.equals(this.spec, v1beta1Order.spec) + && Objects.equals(this.status, v1beta1Order.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1Order {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java new file mode 100644 index 0000000000..6c402e8c97 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java @@ -0,0 +1,192 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** OrderList is a list of Order */ +@ApiModel(description = "OrderList is a list of Order") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + public V1beta1OrderList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should + * convert recognized schemas to the latest internal value, and may reject unrecognized values. + * More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * + * @return apiVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public V1beta1OrderList items(List items) { + + this.items = items; + return this; + } + + public V1beta1OrderList addItemsItem(V1beta1Order itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of orders. More info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * + * @return items + */ + @ApiModelProperty( + required = true, + value = + "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public V1beta1OrderList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer + * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More + * info: + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1OrderList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public V1ListMeta getMetadata() { + return metadata; + } + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderList v1beta1OrderList = (V1beta1OrderList) o; + return Objects.equals(this.apiVersion, v1beta1OrderList.apiVersion) + && Objects.equals(this.items, v1beta1OrderList.items) + && Objects.equals(this.kind, v1beta1OrderList.kind) + && Objects.equals(this.metadata, v1beta1OrderList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java new file mode 100644 index 0000000000..167b89fc93 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java @@ -0,0 +1,186 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** V1beta1OrderSpec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderSpec { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; + + @SerializedName(SERIALIZED_NAME_DNS_NAMES) + private List dnsNames = new ArrayList(); + + public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; + + @SerializedName(SERIALIZED_NAME_ISSUER_REF) + private V1beta1OrderSpecIssuerRef issuerRef; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + + @SerializedName(SERIALIZED_NAME_REQUEST) + private byte[] request; + + public V1beta1OrderSpec commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * CommonName is the common name as specified on the DER encoded CSR. If specified, this value + * must also be present in `dnsNames`. This field must match the corresponding field on + * the DER encoded CSR. + * + * @return commonName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "CommonName is the common name as specified on the DER encoded CSR. If specified, this value must also be present in `dnsNames`. This field must match the corresponding field on the DER encoded CSR.") + public String getCommonName() { + return commonName; + } + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + public V1beta1OrderSpec dnsNames(List dnsNames) { + + this.dnsNames = dnsNames; + return this; + } + + public V1beta1OrderSpec addDnsNamesItem(String dnsNamesItem) { + this.dnsNames.add(dnsNamesItem); + return this; + } + + /** + * DNSNames is a list of DNS names that should be included as part of the Order validation + * process. This field must match the corresponding field on the DER encoded CSR. + * + * @return dnsNames + */ + @ApiModelProperty( + required = true, + value = + "DNSNames is a list of DNS names that should be included as part of the Order validation process. This field must match the corresponding field on the DER encoded CSR.") + public List getDnsNames() { + return dnsNames; + } + + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + public V1beta1OrderSpec issuerRef(V1beta1OrderSpecIssuerRef issuerRef) { + + this.issuerRef = issuerRef; + return this; + } + + /** + * Get issuerRef + * + * @return issuerRef + */ + @ApiModelProperty(required = true, value = "") + public V1beta1OrderSpecIssuerRef getIssuerRef() { + return issuerRef; + } + + public void setIssuerRef(V1beta1OrderSpecIssuerRef issuerRef) { + this.issuerRef = issuerRef; + } + + public V1beta1OrderSpec request(byte[] request) { + + this.request = request; + return this; + } + + /** + * Certificate signing request bytes in DER encoding. This will be used when finalizing the order. + * This field must be set on the order. + * + * @return request + */ + @ApiModelProperty( + required = true, + value = + "Certificate signing request bytes in DER encoding. This will be used when finalizing the order. This field must be set on the order.") + public byte[] getRequest() { + return request; + } + + public void setRequest(byte[] request) { + this.request = request; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderSpec v1beta1OrderSpec = (V1beta1OrderSpec) o; + return Objects.equals(this.commonName, v1beta1OrderSpec.commonName) + && Objects.equals(this.dnsNames, v1beta1OrderSpec.dnsNames) + && Objects.equals(this.issuerRef, v1beta1OrderSpec.issuerRef) + && Arrays.equals(this.request, v1beta1OrderSpec.request); + } + + @Override + public int hashCode() { + return Objects.hash(commonName, dnsNames, issuerRef, Arrays.hashCode(request)); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderSpec {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); + sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java new file mode 100644 index 0000000000..5749999496 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java @@ -0,0 +1,148 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * IssuerRef references a properly configured ACME-type Issuer which should be used to create this + * Order. If the Issuer does not exist, processing will be retried. If the Issuer is not an + * 'ACME' Issuer, an error will be returned and the Order will be marked as failed. + */ +@ApiModel( + description = + "IssuerRef references a properly configured ACME-type Issuer which should be used to create this Order. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Order will be marked as failed.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderSpecIssuerRef { + public static final String SERIALIZED_NAME_GROUP = "group"; + + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_KIND = "kind"; + + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public V1beta1OrderSpecIssuerRef group(String group) { + + this.group = group; + return this; + } + + /** + * Group of the resource being referred to. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Group of the resource being referred to.") + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public V1beta1OrderSpecIssuerRef kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind of the resource being referred to. + * + * @return kind + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind of the resource being referred to.") + public String getKind() { + return kind; + } + + public void setKind(String kind) { + this.kind = kind; + } + + public V1beta1OrderSpecIssuerRef name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the resource being referred to. + * + * @return name + */ + @ApiModelProperty(required = true, value = "Name of the resource being referred to.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderSpecIssuerRef v1beta1OrderSpecIssuerRef = (V1beta1OrderSpecIssuerRef) o; + return Objects.equals(this.group, v1beta1OrderSpecIssuerRef.group) + && Objects.equals(this.kind, v1beta1OrderSpecIssuerRef.kind) + && Objects.equals(this.name, v1beta1OrderSpecIssuerRef.name); + } + + @Override + public int hashCode() { + return Objects.hash(group, kind, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderSpecIssuerRef {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java new file mode 100644 index 0000000000..3231ee380d --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java @@ -0,0 +1,353 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** V1beta1OrderStatus */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderStatus { + public static final String SERIALIZED_NAME_AUTHORIZATIONS = "authorizations"; + + @SerializedName(SERIALIZED_NAME_AUTHORIZATIONS) + private List authorizations = null; + + public static final String SERIALIZED_NAME_CERTIFICATE = "certificate"; + + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + private byte[] certificate; + + public static final String SERIALIZED_NAME_FAILURE_TIME = "failureTime"; + + @SerializedName(SERIALIZED_NAME_FAILURE_TIME) + private OffsetDateTime failureTime; + + public static final String SERIALIZED_NAME_FINALIZE_U_R_L = "finalizeURL"; + + @SerializedName(SERIALIZED_NAME_FINALIZE_U_R_L) + private String finalizeURL; + + public static final String SERIALIZED_NAME_REASON = "reason"; + + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + /** + * State contains the current state of this Order resource. States 'success' and + * 'expired' are 'final' + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + VALID("valid"), + + READY("ready"), + + PENDING("pending"), + + PROCESSING("processing"), + + INVALID("invalid"), + + EXPIRED("expired"), + + ERRORED("errored"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + + @SerializedName(SERIALIZED_NAME_STATE) + private StateEnum state; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public V1beta1OrderStatus authorizations(List authorizations) { + + this.authorizations = authorizations; + return this; + } + + public V1beta1OrderStatus addAuthorizationsItem( + V1beta1OrderStatusAuthorizations authorizationsItem) { + if (this.authorizations == null) { + this.authorizations = new ArrayList(); + } + this.authorizations.add(authorizationsItem); + return this; + } + + /** + * Authorizations contains data returned from the ACME server on what authorizations must be + * completed in order to validate the DNS names specified on the Order. + * + * @return authorizations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Authorizations contains data returned from the ACME server on what authorizations must be completed in order to validate the DNS names specified on the Order.") + public List getAuthorizations() { + return authorizations; + } + + public void setAuthorizations(List authorizations) { + this.authorizations = authorizations; + } + + public V1beta1OrderStatus certificate(byte[] certificate) { + + this.certificate = certificate; + return this; + } + + /** + * Certificate is a copy of the PEM encoded certificate for this Order. This field will be + * populated after the order has been successfully finalized with the ACME server, and the order + * has transitioned to the 'valid' state. + * + * @return certificate + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Certificate is a copy of the PEM encoded certificate for this Order. This field will be populated after the order has been successfully finalized with the ACME server, and the order has transitioned to the 'valid' state.") + public byte[] getCertificate() { + return certificate; + } + + public void setCertificate(byte[] certificate) { + this.certificate = certificate; + } + + public V1beta1OrderStatus failureTime(OffsetDateTime failureTime) { + + this.failureTime = failureTime; + return this; + } + + /** + * FailureTime stores the time that this order failed. This is used to influence garbage + * collection and back-off. + * + * @return failureTime + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "FailureTime stores the time that this order failed. This is used to influence garbage collection and back-off.") + public OffsetDateTime getFailureTime() { + return failureTime; + } + + public void setFailureTime(OffsetDateTime failureTime) { + this.failureTime = failureTime; + } + + public V1beta1OrderStatus finalizeURL(String finalizeURL) { + + this.finalizeURL = finalizeURL; + return this; + } + + /** + * FinalizeURL of the Order. This is used to obtain certificates for this order once it has been + * completed. + * + * @return finalizeURL + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "FinalizeURL of the Order. This is used to obtain certificates for this order once it has been completed.") + public String getFinalizeURL() { + return finalizeURL; + } + + public void setFinalizeURL(String finalizeURL) { + this.finalizeURL = finalizeURL; + } + + public V1beta1OrderStatus reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason optionally provides more information about a why the order is in the current state. + * + * @return reason + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Reason optionally provides more information about a why the order is in the current state.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public V1beta1OrderStatus state(StateEnum state) { + + this.state = state; + return this; + } + + /** + * State contains the current state of this Order resource. States 'success' and + * 'expired' are 'final' + * + * @return state + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "State contains the current state of this Order resource. States 'success' and 'expired' are 'final'") + public StateEnum getState() { + return state; + } + + public void setState(StateEnum state) { + this.state = state; + } + + public V1beta1OrderStatus url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the Order. This will initially be empty when the resource is first created. The Order + * controller will populate this field when the Order is first processed. This field will be + * immutable after it is initially set. + * + * @return url + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "URL of the Order. This will initially be empty when the resource is first created. The Order controller will populate this field when the Order is first processed. This field will be immutable after it is initially set.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderStatus v1beta1OrderStatus = (V1beta1OrderStatus) o; + return Objects.equals(this.authorizations, v1beta1OrderStatus.authorizations) + && Arrays.equals(this.certificate, v1beta1OrderStatus.certificate) + && Objects.equals(this.failureTime, v1beta1OrderStatus.failureTime) + && Objects.equals(this.finalizeURL, v1beta1OrderStatus.finalizeURL) + && Objects.equals(this.reason, v1beta1OrderStatus.reason) + && Objects.equals(this.state, v1beta1OrderStatus.state) + && Objects.equals(this.url, v1beta1OrderStatus.url); + } + + @Override + public int hashCode() { + return Objects.hash( + authorizations, Arrays.hashCode(certificate), failureTime, finalizeURL, reason, state, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderStatus {\n"); + sb.append(" authorizations: ").append(toIndentedString(authorizations)).append("\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" failureTime: ").append(toIndentedString(failureTime)).append("\n"); + sb.append(" finalizeURL: ").append(toIndentedString(finalizeURL)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java new file mode 100644 index 0000000000..3c7362fb55 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java @@ -0,0 +1,303 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ACMEAuthorization contains data returned from the ACME server on an authorization that must be + * completed in order validate a DNS name on an ACME Order resource. + */ +@ApiModel( + description = + "ACMEAuthorization contains data returned from the ACME server on an authorization that must be completed in order validate a DNS name on an ACME Order resource.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderStatusAuthorizations { + public static final String SERIALIZED_NAME_CHALLENGES = "challenges"; + + @SerializedName(SERIALIZED_NAME_CHALLENGES) + private List challenges = null; + + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private String identifier; + + /** + * InitialState is the initial state of the ACME authorization when first fetched from the ACME + * server. If an Authorization is already 'valid', the Order controller will not create a + * Challenge resource for the authorization. This will occur when working with an ACME server that + * enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set + * and 'identifier' is set, the state is assumed to be pending and a Challenge will be + * created. + */ + @JsonAdapter(InitialStateEnum.Adapter.class) + public enum InitialStateEnum { + VALID("valid"), + + READY("ready"), + + PENDING("pending"), + + PROCESSING("processing"), + + INVALID("invalid"), + + EXPIRED("expired"), + + ERRORED("errored"); + + private String value; + + InitialStateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InitialStateEnum fromValue(String value) { + for (InitialStateEnum b : InitialStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final InitialStateEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public InitialStateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return InitialStateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; + + @SerializedName(SERIALIZED_NAME_INITIAL_STATE) + private InitialStateEnum initialState; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; + + @SerializedName(SERIALIZED_NAME_WILDCARD) + private Boolean wildcard; + + public V1beta1OrderStatusAuthorizations challenges( + List challenges) { + + this.challenges = challenges; + return this; + } + + public V1beta1OrderStatusAuthorizations addChallengesItem( + V1beta1OrderStatusChallenges challengesItem) { + if (this.challenges == null) { + this.challenges = new ArrayList(); + } + this.challenges.add(challengesItem); + return this; + } + + /** + * Challenges specifies the challenge types offered by the ACME server. One of these challenge + * types will be selected when validating the DNS name and an appropriate Challenge resource will + * be created to perform the ACME challenge process. + * + * @return challenges + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Challenges specifies the challenge types offered by the ACME server. One of these challenge types will be selected when validating the DNS name and an appropriate Challenge resource will be created to perform the ACME challenge process.") + public List getChallenges() { + return challenges; + } + + public void setChallenges(List challenges) { + this.challenges = challenges; + } + + public V1beta1OrderStatusAuthorizations identifier(String identifier) { + + this.identifier = identifier; + return this; + } + + /** + * Identifier is the DNS name to be validated as part of this authorization + * + * @return identifier + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Identifier is the DNS name to be validated as part of this authorization") + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public V1beta1OrderStatusAuthorizations initialState(InitialStateEnum initialState) { + + this.initialState = initialState; + return this; + } + + /** + * InitialState is the initial state of the ACME authorization when first fetched from the ACME + * server. If an Authorization is already 'valid', the Order controller will not create a + * Challenge resource for the authorization. This will occur when working with an ACME server that + * enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set + * and 'identifier' is set, the state is assumed to be pending and a Challenge will be + * created. + * + * @return initialState + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "InitialState is the initial state of the ACME authorization when first fetched from the ACME server. If an Authorization is already 'valid', the Order controller will not create a Challenge resource for the authorization. This will occur when working with an ACME server that enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set and 'identifier' is set, the state is assumed to be pending and a Challenge will be created.") + public InitialStateEnum getInitialState() { + return initialState; + } + + public void setInitialState(InitialStateEnum initialState) { + this.initialState = initialState; + } + + public V1beta1OrderStatusAuthorizations url(String url) { + + this.url = url; + return this; + } + + /** + * URL is the URL of the Authorization that must be completed + * + * @return url + */ + @ApiModelProperty( + required = true, + value = "URL is the URL of the Authorization that must be completed") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public V1beta1OrderStatusAuthorizations wildcard(Boolean wildcard) { + + this.wildcard = wildcard; + return this; + } + + /** + * Wildcard will be true if this authorization is for a wildcard DNS name. If this is true, the + * identifier will be the *non-wildcard* version of the DNS name. For example, if + * '*.example.com' is the DNS name being validated, this field will be 'true' and + * the 'identifier' field will be 'example.com'. + * + * @return wildcard + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Wildcard will be true if this authorization is for a wildcard DNS name. If this is true, the identifier will be the *non-wildcard* version of the DNS name. For example, if '*.example.com' is the DNS name being validated, this field will be 'true' and the 'identifier' field will be 'example.com'.") + public Boolean getWildcard() { + return wildcard; + } + + public void setWildcard(Boolean wildcard) { + this.wildcard = wildcard; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderStatusAuthorizations v1beta1OrderStatusAuthorizations = + (V1beta1OrderStatusAuthorizations) o; + return Objects.equals(this.challenges, v1beta1OrderStatusAuthorizations.challenges) + && Objects.equals(this.identifier, v1beta1OrderStatusAuthorizations.identifier) + && Objects.equals(this.initialState, v1beta1OrderStatusAuthorizations.initialState) + && Objects.equals(this.url, v1beta1OrderStatusAuthorizations.url) + && Objects.equals(this.wildcard, v1beta1OrderStatusAuthorizations.wildcard); + } + + @Override + public int hashCode() { + return Objects.hash(challenges, identifier, initialState, url, wildcard); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderStatusAuthorizations {\n"); + sb.append(" challenges: ").append(toIndentedString(challenges)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java new file mode 100644 index 0000000000..d2c79b1ae6 --- /dev/null +++ b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java @@ -0,0 +1,159 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.cert.manager.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** + * Challenge specifies a challenge offered by the ACME server for an Order. An appropriate Challenge + * resource can be created to perform the ACME challenge process. + */ +@ApiModel( + description = + "Challenge specifies a challenge offered by the ACME server for an Order. An appropriate Challenge resource can be created to perform the ACME challenge process.") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + date = "2020-08-18T19:55:23.947Z[Etc/UTC]") +public class V1beta1OrderStatusChallenges { + public static final String SERIALIZED_NAME_TOKEN = "token"; + + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public V1beta1OrderStatusChallenges token(String token) { + + this.token = token; + return this; + } + + /** + * Token is the token that must be presented for this challenge. This is used to compute the + * 'key' that must also be presented. + * + * @return token + */ + @ApiModelProperty( + required = true, + value = + "Token is the token that must be presented for this challenge. This is used to compute the 'key' that must also be presented.") + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public V1beta1OrderStatusChallenges type(String type) { + + this.type = type; + return this; + } + + /** + * Type is the type of challenge being offered, e.g. 'http-01', 'dns-01', + * 'tls-sni-01', etc. This is the raw value retrieved from the ACME server. Only + * 'http-01' and 'dns-01' are supported by cert-manager, other values will be + * ignored. + * + * @return type + */ + @ApiModelProperty( + required = true, + value = + "Type is the type of challenge being offered, e.g. 'http-01', 'dns-01', 'tls-sni-01', etc. This is the raw value retrieved from the ACME server. Only 'http-01' and 'dns-01' are supported by cert-manager, other values will be ignored.") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public V1beta1OrderStatusChallenges url(String url) { + + this.url = url; + return this; + } + + /** + * URL is the URL of this challenge. It can be used to retrieve additional metadata about the + * Challenge from the ACME server. + * + * @return url + */ + @ApiModelProperty( + required = true, + value = + "URL is the URL of this challenge. It can be used to retrieve additional metadata about the Challenge from the ACME server.") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1beta1OrderStatusChallenges v1beta1OrderStatusChallenges = (V1beta1OrderStatusChallenges) o; + return Objects.equals(this.token, v1beta1OrderStatusChallenges.token) + && Objects.equals(this.type, v1beta1OrderStatusChallenges.type) + && Objects.equals(this.url, v1beta1OrderStatusChallenges.url); + } + + @Override + public int hashCode() { + return Objects.hash(token, type, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1beta1OrderStatusChallenges {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy new file mode 100644 index 0000000000..054e3cd37e --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.basic + +import io.kubernetes.client.openapi.Configuration +import io.kubernetes.client.openapi.apis.CoreV1Api +import io.kubernetes.client.openapi.models.V1Namespace +import io.kubernetes.client.openapi.models.V1ObjectMeta +import io.kubernetes.client.openapi.models.V1Status +import io.kubernetes.client.util.ClientBuilder +import spock.lang.Specification + +class CoreV1ApiTest extends Specification { + def "Create Namespace then Delete should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + def corev1api = new CoreV1Api(apiClient) + Configuration.setDefaultApiClient(apiClient) + def namespaceFoo = new V1Namespace().metadata(new V1ObjectMeta().name("e2e-basic")) + when: + V1Namespace created = corev1api.createNamespace(namespaceFoo, null, null, null, null) + then: + created != null + when: + V1Status deleted = corev1api.deleteNamespace("e2e-basic", null, null, null, null, null, null, null) + then: + deleted != null + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy new file mode 100644 index 0000000000..37ea52660b --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy @@ -0,0 +1,66 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.csr + +import java.security.KeyPairGenerator +import java.security.SecureRandom + +import io.kubernetes.client.openapi.ApiClient +import io.kubernetes.client.openapi.models.V1CertificateSigningRequest +import io.kubernetes.client.util.CSRUtils +import io.kubernetes.client.util.ClientBuilder +import io.kubernetes.client.util.version.Version +import spock.lang.Specification +import spock.util.concurrent.PollingConditions + +class CSRTest extends Specification { + def "Build client instance via CSR should work"() { + // initialize test environment + given: + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA") + keyGen.initialize(2048, new SecureRandom()) + ApiClient bootstrapApiClient = ClientBuilder.defaultClient() + + // generating key-pair + when: + def keyPair = keyGen.generateKeyPair() + then: + keyPair != null + + // sign new CSR + when: + def csrBytes = CSRUtils.sign(keyPair, "foo") + then: + csrBytes != null + + // creates CSR object against cluster + when: + def newCsr = CSRUtils.newV1CertificateSigningRequest("foo", csrBytes) + def created = CSRUtils.createIfAbsent(bootstrapApiClient, newCsr) + then: + created + + // reload certificates from CSR + when: + CSRUtils.approve(bootstrapApiClient, "foo") + def signedApiClient = ClientBuilder.fromCertificateSigningRequest(bootstrapApiClient, keyPair.getPrivate(), newCsr) + then: + signedApiClient != null + + // use the new client to get "/version" + when: + def v = new Version(signedApiClient).getVersion() + then: + v != null + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy new file mode 100644 index 0000000000..0a47219210 --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy @@ -0,0 +1,38 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.dynamic + + +import io.kubernetes.client.openapi.models.V1Namespace +import io.kubernetes.client.openapi.models.V1ObjectMeta +import io.kubernetes.client.util.ClientBuilder +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi +import io.kubernetes.client.util.generic.dynamic.Dynamics +import spock.lang.Specification + +class DynamicApiTest extends Specification { + def "Create Namespace then Delete should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + def dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient) + def namespaceFoo = new V1Namespace().metadata(new V1ObjectMeta().name("e2e-dynamic")) + when: + def createdNamespace = dynamicApi.create(Dynamics.newFromJson(apiClient.getJSON().serialize(namespaceFoo))) + then: + createdNamespace != null + when: + def deleted = dynamicApi.delete("e2e-dynamic").throwsApiException().getObject() + then: + deleted != null + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy new file mode 100644 index 0000000000..4ffe3dce4a --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.informer + +import io.kubernetes.client.informer.SharedInformerFactory +import io.kubernetes.client.informer.cache.Lister +import io.kubernetes.client.openapi.models.V1Namespace +import io.kubernetes.client.openapi.models.V1NamespaceList +import io.kubernetes.client.util.ClientBuilder +import io.kubernetes.client.util.generic.GenericKubernetesApi +import spock.lang.Specification +import spock.util.concurrent.PollingConditions + +class NamespaceInformerTest extends Specification { + + def "list-watching namespaces should work"() { + given: + def conditions = new PollingConditions() + def apiClient = ClientBuilder.defaultClient() + def api = new GenericKubernetesApi( + V1Namespace.class, + V1NamespaceList.class, + "", + "v1", + "namespaces", + apiClient) + def informerFactory = new SharedInformerFactory() + def nsInformer = informerFactory.sharedIndexInformerFor( + api, + V1Namespace.class, + 0) + def nsLister = new Lister(nsInformer.getIndexer()) + when: + informerFactory.startAllRegisteredInformers() + then: + conditions.eventually { + nsInformer.hasSynced() + nsLister.list().size() > 0 + } + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy new file mode 100644 index 0000000000..759263cf65 --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy @@ -0,0 +1,61 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.kubectl + +import io.kubernetes.client.extended.kubectl.Kubectl +import io.kubernetes.client.extended.kubectl.exception.KubectlException +import io.kubernetes.client.openapi.ApiException +import io.kubernetes.client.openapi.Configuration +import io.kubernetes.client.openapi.models.V1Container +import io.kubernetes.client.openapi.models.V1Node +import io.kubernetes.client.openapi.models.V1ObjectMeta +import io.kubernetes.client.openapi.models.V1Pod +import io.kubernetes.client.openapi.models.V1PodSpec +import io.kubernetes.client.util.ClientBuilder +import spock.lang.Specification + +class KubectlDrainTest extends Specification { + def "Kubectl drain should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + Configuration.setDefaultApiClient(apiClient) + def testNode = new V1Node() + .metadata(new V1ObjectMeta().name("foo")) + def testPod = new V1Pod() + .metadata(new V1ObjectMeta() + .namespace("default") + .name("bar")) + .spec(new V1PodSpec() + .nodeName("foo") + .containers(Arrays.asList( + new V1Container().name("c1").image("nginx") + ))) + when: + V1Node createdNode = Kubectl.create(V1Node.class).resource(testNode).execute() + V1Pod createdPod = Kubectl.create(V1Pod.class).resource(testPod).execute() + then: + createdNode != null + createdPod != null + when: + V1Node drainedNode = Kubectl.drain().gracePeriod(0).name("foo").execute() + then: + drainedNode != null + when: + Kubectl.get(V1Pod.class).namespace("default").name("bar").execute() + then: + def e = thrown KubectlException + e.getCause().class == ApiException.class + cleanup: + Kubectl.delete(V1Node.class).name("foo").execute() + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy new file mode 100644 index 0000000000..55a719ffd6 --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy @@ -0,0 +1,85 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.kubectl + +import io.kubernetes.client.extended.kubectl.Kubectl +import io.kubernetes.client.openapi.models.V1Namespace +import io.kubernetes.client.openapi.models.V1ObjectMeta +import io.kubernetes.client.util.ClientBuilder +import spock.lang.Specification + +class KubectlNamespaceTest extends Specification { + + def "Kubectl manipulating namespace should work"() { + given: + def apiClient = ClientBuilder.defaultClient(); + + when: + def createdNamespace = Kubectl.create(V1Namespace.class) + .apiClient(apiClient) + .resource(new V1Namespace() + .apiVersion("v1") + .metadata( + new V1ObjectMeta() + .name("foo"))) + .execute() + then: + createdNamespace != null + Kubectl.get(V1Namespace.class) + .apiClient(apiClient) + .name("foo") + .execute() != null + + when: + def appliedNamespace = Kubectl.apply(V1Namespace.class) + .apiClient(apiClient) + .resource(new V1Namespace() + .apiVersion("v1") + .kind("Namespace") + .metadata(new V1ObjectMeta() + .name("foo") + .putAnnotationsItem("k", "v"))) + .execute() + then: + appliedNamespace != null + Kubectl.get(V1Namespace.class) + .apiClient(apiClient) + .name("foo") + .execute().metadata.getAnnotations().get("k") == "v" + + when: + def replacedNamespace = Kubectl.replace(V1Namespace.class) + .apiClient(apiClient) + .resource(new V1Namespace() + .apiVersion("v1") + .kind("Namespace") + .metadata(new V1ObjectMeta() + .name("foo") + .putAnnotationsItem("k", "v2"))) + .execute() + then: + replacedNamespace != null + Kubectl.get(V1Namespace.class) + .apiClient(apiClient) + .name("foo") + .execute().metadata.getAnnotations().get("k") == "v2" + + when: + def deletedNamespace = Kubectl.delete(V1Namespace.class) + .apiClient(apiClient) + .name("foo") + .execute() + then: + deletedNamespace != null + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy new file mode 100644 index 0000000000..83b3413eea --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy @@ -0,0 +1,216 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.kubectl + +import java.nio.charset.StandardCharsets +import java.time.Duration + +import org.awaitility.Awaitility + +import io.kubernetes.client.extended.kubectl.Kubectl +import io.kubernetes.client.openapi.Configuration +import io.kubernetes.client.openapi.models.V1DaemonSet +import io.kubernetes.client.openapi.models.V1Deployment +import io.kubernetes.client.openapi.models.V1StatefulSet +import io.kubernetes.client.util.ClientBuilder +import io.kubernetes.client.util.Streams +import io.kubernetes.client.util.Yaml +import spock.lang.Specification + +class KubectlRolloutTest extends Specification { + + def "Kubectl rollout daemonset should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + Configuration.setDefaultApiClient(apiClient) + // initial daemonset has only one container + def daemonSet = Yaml.load(getResourceFileAsString("test-daemonset.yaml")) + // updating daemonset has two containers + def updatingDaemonSet = Yaml.load(getResourceFileAsString("test-daemonset-updated.yaml")) + + when: + def createdDaemonSet = Kubectl.create(V1DaemonSet.class) + .resource(daemonSet) + .execute() + then: + createdDaemonSet != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1DaemonSet.class) + .history() + .namespace(daemonSet.metadata.namespace) + .name(daemonSet.metadata.name) + .execute() + .size() == 1 + } + + when: + def updatedDaemonSet = Kubectl.replace(V1DaemonSet.class) + .resource(updatingDaemonSet) + .execute() + then: + updatedDaemonSet != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1DaemonSet.class) + .history() + .namespace(daemonSet.metadata.namespace) + .name(daemonSet.metadata.name) + .execute() + .size() == 2 + } + Kubectl.rollout(V1DaemonSet.class) + .history() + .revision(2) + .namespace(daemonSet.metadata.namespace) + .name(daemonSet.metadata.name) + .execute() + .spec.containers.size() == 2 + + cleanup: + Kubectl.delete(V1DaemonSet.class) + .namespace(daemonSet.metadata.namespace) + .name(daemonSet.metadata.name) + .execute() + } + + + def "Kubectl rollout deployment should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + Configuration.setDefaultApiClient(apiClient) + // initial deployment has only one container + def deployment = Yaml.load(getResourceFileAsString("test-deployment.yaml")) + // updating deployment has two containers + def updatingDeployment = Yaml.load(getResourceFileAsString("test-deployment-updated.yaml")) + + when: + def createdDeployment = Kubectl.create(V1Deployment.class) + .resource(deployment) + .execute() + then: + createdDeployment != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1Deployment.class) + .history() + .namespace(deployment.metadata.namespace) + .name(deployment.metadata.name) + .execute() + .size() == 1 + } + + when: + def updatedDaemonSet = Kubectl.replace(V1Deployment.class) + .resource(updatingDeployment) + .execute() + then: + updatedDaemonSet != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1Deployment.class) + .history() + .namespace(deployment.metadata.namespace) + .name(deployment.metadata.name) + .execute() + .size() == 2 + } + Kubectl.rollout(V1Deployment.class) + .history() + .revision(2) + .namespace(deployment.metadata.namespace) + .name(deployment.metadata.name) + .execute() + .spec.containers.size() == 2 + + cleanup: + Kubectl.delete(V1Deployment.class) + .namespace(deployment.metadata.namespace) + .name(deployment.metadata.name) + .execute() + } + + + def "Kubectl rollout statefulset should work"() { + given: + def apiClient = ClientBuilder.defaultClient() + Configuration.setDefaultApiClient(apiClient) + // initial deployment has only one container + def statefulset = Yaml.load(getResourceFileAsString("test-statefulset.yaml")) + // updating deployment has two containers + def updatingStatefulSet = Yaml.load(getResourceFileAsString("test-statefulset-updated.yaml")) + + when: + def createdStatefulSet = Kubectl.create(V1StatefulSet.class) + .resource(statefulset) + .execute() + then: + createdStatefulSet != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1StatefulSet.class) + .history() + .namespace(statefulset.metadata.namespace) + .name(statefulset.metadata.name) + .execute() + .size() == 1 + } + + when: + def updatedDaemonSet = Kubectl.replace(V1StatefulSet.class) + .resource(updatingStatefulSet) + .execute() + then: + updatedDaemonSet != null + Awaitility.await() + .pollInterval(Duration.ofSeconds(1)) + .atMost(Duration.ofSeconds(3)) + .until{ + -> Kubectl.rollout(V1StatefulSet.class) + .history() + .namespace(statefulset.metadata.namespace) + .name(statefulset.metadata.name) + .execute() + .size() == 2 + } + Kubectl.rollout(V1StatefulSet.class) + .history() + .revision(2) + .namespace(statefulset.metadata.namespace) + .name(statefulset.metadata.name) + .execute() + .spec.containers.size() == 2 + + cleanup: + Kubectl.delete(V1StatefulSet.class) + .namespace(statefulset.metadata.namespace) + .name(statefulset.metadata.name) + .execute() + } + + + private String getResourceFileAsString(String filename) { + def url = this.getClass().getClassLoader().getResource(filename) + return Streams.toString(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8)); + } +} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy new file mode 100644 index 0000000000..eb57310328 --- /dev/null +++ b/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy @@ -0,0 +1,46 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.e2e.util + +import io.kubernetes.client.Discovery +import io.kubernetes.client.apimachinery.GroupVersionKind +import io.kubernetes.client.apimachinery.GroupVersionResource +import io.kubernetes.client.openapi.models.V1CustomResourceDefinition +import io.kubernetes.client.openapi.models.V1Deployment +import io.kubernetes.client.openapi.models.V1Pod +import io.kubernetes.client.util.ClientBuilder +import io.kubernetes.client.util.ModelMapper +import spock.lang.Specification + +class ModelMapperTest extends Specification { + + def "api-discovery should work"() { + given: + def apiClient = ClientBuilder.defaultClient(); + def discovery = new Discovery(apiClient) + ModelMapper.refresh(discovery); + + expect: + new GroupVersionKind("", "v1", "Pod") == ModelMapper.getGroupVersionKindByClass(V1Pod.class) + new GroupVersionResource("", "v1", "pods") == ModelMapper.getGroupVersionResourceByClass(V1Pod.class) + ModelMapper.isNamespaced(V1Pod.class) + + new GroupVersionKind("apps", "v1", "Deployment") == ModelMapper.getGroupVersionKindByClass(V1Deployment.class) + new GroupVersionResource("apps", "v1", "deployments") == ModelMapper.getGroupVersionResourceByClass(V1Deployment.class) + ModelMapper.isNamespaced(V1Deployment.class) + + new GroupVersionKind("apiextensions.k8s.io", "v1", "CustomResourceDefinition") == ModelMapper.getGroupVersionKindByClass(V1CustomResourceDefinition.class) + new GroupVersionResource("apiextensions.k8s.io", "v1", "customresourcedefinitions") == ModelMapper.getGroupVersionResourceByClass(V1CustomResourceDefinition.class) + !ModelMapper.isNamespaced(V1CustomResourceDefinition.class) + } +} diff --git a/examples/examples-release-16/Dockerfile b/examples/examples-release-16/Dockerfile new file mode 100644 index 0000000000..ac90eb1d67 --- /dev/null +++ b/examples/examples-release-16/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-jre + +COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar + +CMD ["java", "-jar", "/examples.jar"] + + diff --git a/examples/examples-release-16/README.md b/examples/examples-release-16/README.md new file mode 100644 index 0000000000..98a3dee175 --- /dev/null +++ b/examples/examples-release-16/README.md @@ -0,0 +1,13 @@ +# Running examples + +```sh +export REPO_ROOT=/path/to/client-java/repo + +cd ${REPO_ROOT}/ +mvn install + +cd ${REPO_ROOT}/examples/examples-13 +mvn compile +mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" +``` + diff --git a/examples/examples-release-16/createPod.sh b/examples/examples-release-16/createPod.sh new file mode 100755 index 0000000000..18a9841317 --- /dev/null +++ b/examples/examples-release-16/createPod.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# creates a pod and runs +# Example.java(list pods for all namespaces) on starting of pod + +# Exit on any error. +set -e + +if ! which minikube > /dev/null; then + echo "This script requires minikube installed." + exit 100 +fi + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +export REPO_ROOT=${dir}/.. + +cd ${REPO_ROOT} +mvn install + +cd ${REPO_ROOT}/examples +mvn package + +eval $(minikube docker-env) +docker build -t test/examples:1.0 . +kubectl apply -f test.yaml diff --git a/examples/examples-release-16/pom.xml b/examples/examples-release-16/pom.xml new file mode 100644 index 0000000000..154a5e9639 --- /dev/null +++ b/examples/examples-release-16/pom.xml @@ -0,0 +1,118 @@ + + 4.0.0 + + + io.kubernetes + client-java-examples-parent + 25.0.0-legacy-SNAPSHOT + .. + + + client-java-examples-release-16 + client-java-examples-release-16 + + + + ch.qos.logback + logback-classic + runtime + + + io.prometheus + simpleclient + 0.16.0 + + + io.prometheus + simpleclient_httpserver + 0.16.0 + + + io.kubernetes + client-java-api + 16.0.0 + + + io.kubernetes + client-java + 16.0.0 + + + io.kubernetes + client-java-extended + 16.0.0 + + + io.kubernetes + client-java-spring-integration + 16.0.0 + + + io.kubernetes + client-java-proto + 16.0.0 + + + commons-cli + commons-cli + + + io.kubernetes + client-java-cert-manager-models + 10.0.1 + + + io.kubernetes + client-java-prometheus-operator-models + 10.0.1 + + + + junit + junit + test + + + com.github.tomakehurst + wiremock + test + + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-actuator + ${spring.boot.version} + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + true + + + + + + \ No newline at end of file diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java new file mode 100644 index 0000000000..7f753b8d8f --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Attach; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" + * + *

From inside $REPO_DIR/examples + */ +public class AttachExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Attach attach = new Attach(); + final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); + + new Thread( + new Runnable() { + public void run() { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + OutputStream output = result.getStandardInputStream(); + try { + while (true) { + String line = in.readLine(); + output.write(line.getBytes()); + output.write('\n'); + output.flush(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getStandardOutputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + result.close(); + System.exit(0); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java new file mode 100644 index 0000000000..b616a18ee9 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; +import io.cert.manager.models.V1beta1Issuer; +import io.cert.manager.models.V1beta1IssuerList; +import io.cert.manager.models.V1beta1IssuerSpec; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +/** + * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a + * Kubernetes cluster where cert-manager is installed + */ +public class CertManagerExample { + public static void main(String[] args) throws IOException { + GenericKubernetesApi issuerApi = + new GenericKubernetesApi<>( + V1beta1Issuer.class, + V1beta1IssuerList.class, + "cert-manager.io", + "v1beta1", + "issuers", + ClientBuilder.defaultClient()); + issuerApi.create( + new V1beta1Issuer() + .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) + .kind("Issuer") + .apiVersion("cert-manager.io/v1beta1") + .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java new file mode 100644 index 0000000000..fed0e544d3 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java @@ -0,0 +1,163 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.ControllerManager; +import io.kubernetes.client.extended.controller.LeaderElectingController; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.extended.event.EventType; +import io.kubernetes.client.extended.event.legacy.EventBroadcaster; +import io.kubernetes.client.extended.event.legacy.EventRecorder; +import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1EventSource; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.util.CallGeneratorParams; +import java.io.IOException; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +public class ControllerExample { + public static void main(String[] args) throws IOException { + + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + // instantiating an informer-factory, and there should be only one informer-factory + // globally. + SharedInformerFactory informerFactory = new SharedInformerFactory(); + // registering node-informer into the informer-factory. + SharedIndexInformer nodeInformer = + informerFactory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + informerFactory.startAllRegisteredInformers(); + + EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); + + // nodeReconciler prints node information on events + NodePrintingReconciler nodeReconciler = + new NodePrintingReconciler( + nodeInformer, + eventBroadcaster.newRecorder( + new V1EventSource().host("localhost").component("node-printer"))); + + // Use builder library to construct a default controller. + Controller controller = + ControllerBuilder.defaultBuilder(informerFactory) + .watch( + (workQueue) -> + ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) + .withWorkQueueKeyFunc( + (V1Node node) -> + new Request(node.getMetadata().getName())) // optional, default to + .withOnAddFilter( + (V1Node createdNode) -> + createdNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onAdd filter + .withOnUpdateFilter( + (V1Node oldNode, V1Node newNode) -> + newNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onUpdate filter + .withOnDeleteFilter( + (V1Node deletedNode, Boolean stateUnknown) -> + deletedNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onDelete filter + .build()) + .withReconciler(nodeReconciler) // required, set the actual reconciler + .withName("node-printing-controller") // optional, set name for controller + .withWorkerCount(4) // optional, set worker thread count + .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the + // cache has synced up + .build(); + + // Use builder library to manage one or multiple controllers. + ControllerManager controllerManager = + ControllerBuilder.controllerManagerBuilder(informerFactory) + .addController(controller) + .build(); + + LeaderElectingController leaderElectingController = + new LeaderElectingController( + new LeaderElector( + new LeaderElectionConfig( + new EndpointsLock("kube-system", "leader-election", "foo"), + Duration.ofMillis(10000), + Duration.ofMillis(8000), + Duration.ofMillis(5000))), + controllerManager); + + leaderElectingController.run(); + } + + static class NodePrintingReconciler implements Reconciler { + + private Lister nodeLister; + private EventRecorder eventRecorder; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, EventRecorder recorder) { + this.nodeLister = new Lister<>(nodeInformer.getIndexer()); + this.eventRecorder = recorder; + } + + @Override + public Result reconcile(Request request) { + V1Node node = this.nodeLister.get(request.getName()); + System.out.println("triggered reconciling " + node.getMetadata().getName()); + this.eventRecorder.event( + node, + EventType.Normal, + "Print Node", + "Successfully printed %s", + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java new file mode 100644 index 0000000000..bbb6575676 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Copy; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import io.kubernetes.client.util.exception.CopyNotSupportedException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" + * + *

From inside $REPO_DIR/examples + */ +public class CopyExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, CopyNotSupportedException { + String podName = "kube-addon-manager-minikube"; + String namespace = "kube-system"; + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Copy copy = new Copy(); + InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); + Streams.copy(dataStream, System.out); + + copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); + + System.out.println("Done!"); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java new file mode 100644 index 0000000000..b8cb04616d --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; +import java.io.IOException; + +public class DynamicClientExample { + + public static void main(String[] args) throws IOException, ApiException { + + ApiClient apiClient = ClientBuilder.standard().build(); + + // retrieving the latest state of the default namespace + DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); + DynamicKubernetesObject defaultNamespace = + dynamicApi.get("default").throwsApiException().getObject(); + + // attaching a "foo=bar" label to the default namespace + defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); + DynamicKubernetesObject updatedDefaultNamespace = + dynamicApi.update(defaultNamespace).throwsApiException().getObject(); + + System.out.println(updatedDefaultNamespace); + + apiClient.getHttpClient().connectionPool().evictAll(); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java new file mode 100644 index 0000000000..95d7fa51bc --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.Example" + * + *

From inside $REPO_DIR/examples + */ +public class Example { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java new file mode 100644 index 0000000000..acea8e815a --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Exec; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExecExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, ParseException { + final Options options = new Options(); + options.addOption(new Option("p", "pod", true, "The name of the pod")); + options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); + + CommandLineParser parser = new DefaultParser(); + CommandLine cmd = parser.parse(options, args); + + String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); + String namespace = cmd.getOptionValue("n", "default"); + args = cmd.getArgs(); + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Exec exec = new Exec(); + boolean tty = System.console() != null; + // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] + // {"sh", "-c", "echo foo"}, true, tty); + final Process proc = + exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); + + Thread in = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(System.in, proc.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + in.start(); + + Thread out = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(proc.getInputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + out.start(); + + proc.waitFor(); + + // wait for any last output; no need to wait for input thread + out.join(); + + proc.destroy(); + + System.exit(proc.exitValue()); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java new file mode 100644 index 0000000000..e2b9c22177 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java @@ -0,0 +1,274 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentList; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1ServiceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExpandedExample { + + private static CoreV1Api COREV1_API; + private static final String DEFAULT_NAME_SPACE = "default"; + private static final Integer TIME_OUT_VALUE = 180; + private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); + + /** + * Main method + * + * @param args + */ + public static void main(String[] args) { + try { + ApiClient client = Config.defaultClient(); + // To change the context of k8s cluster, you can use + // io.kubernetes.client.util.KubeConfig + Configuration.setDefaultApiClient(client); + COREV1_API = new CoreV1Api(client); + + // ScaleUp/ScaleDown the Deployment pod + // Please change the name of Deployment? + System.out.println("----- Scale Deployment Start -----"); + scaleDeployment("account-service", 5); + + // List all of the namaspaces and pods + List nameSpaces = getAllNameSpaces(); + nameSpaces.stream() + .forEach( + namespace -> { + try { + System.out.println("----- " + namespace + " -----"); + getNamespacedPod(namespace).stream().forEach(System.out::println); + } catch (ApiException ex) { + LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); + } + }); + + // Print all of the Services + System.out.println("----- Print list all Services Start -----"); + List services = getServices(); + services.stream().forEach(System.out::println); + System.out.println("----- Print list all Services End -----"); + + // Print log of specific pod. In this example show the first pod logs. + System.out.println("----- Print Log of Specific Pod Start -----"); + String firstPodName = getPods().get(0); + printLog(DEFAULT_NAME_SPACE, firstPodName); + System.out.println("----- Print Log of Specific Pod End -----"); + } catch (ApiException | IOException ex) { + LOGGER.warn("Exception had occured ", ex); + } + } + + /** + * Get all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getAllNameSpaces() throws ApiException { + V1NamespaceList listNamespace = + COREV1_API.listNamespace( + "true", null, null, null, null, 0, null, null, Integer.MAX_VALUE, Boolean.FALSE); + List list = + listNamespace.getItems().stream() + .map(v1Namespace -> v1Namespace.getMetadata().getName()) + .collect(Collectors.toList()); + return list; + } + + /** + * List all pod names in all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getPods() throws ApiException { + V1PodList v1podList = + COREV1_API.listPodForAllNamespaces( + null, null, null, null, null, null, null, null, null, null); + List podList = + v1podList.getItems().stream() + .map(v1Pod -> v1Pod.getMetadata().getName()) + .collect(Collectors.toList()); + return podList; + } + + /** + * List all pod in the default namespace + * + * @return + * @throws ApiException + */ + public static List getNamespacedPod() throws ApiException { + return getNamespacedPod(DEFAULT_NAME_SPACE, null); + } + + /** + * List pod in specific namespace + * + * @param namespace + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace) throws ApiException { + return getNamespacedPod(namespace, null); + } + + /** + * List pod in specific namespace with label + * + * @param namespace + * @param label + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace, String label) throws ApiException { + V1PodList listNamespacedPod = + COREV1_API.listNamespacedPod( + namespace, + null, + null, + null, + null, + label, + Integer.MAX_VALUE, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + List listPods = + listNamespacedPod.getItems().stream() + .map(v1pod -> v1pod.getMetadata().getName()) + .collect(Collectors.toList()); + return listPods; + } + + /** + * List all Services in default namespace + * + * @return + * @throws ApiException + */ + public static List getServices() throws ApiException { + V1ServiceList listNamespacedService = + COREV1_API.listNamespacedService( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + Integer.MAX_VALUE, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + return listNamespacedService.getItems().stream() + .map(v1service -> v1service.getMetadata().getName()) + .collect(Collectors.toList()); + } + + /** + * Scale up/down the number of pod in Deployment + * + * @param deploymentName + * @param numberOfReplicas + * @throws ApiException + */ + public static void scaleDeployment(String deploymentName, int numberOfReplicas) + throws ApiException { + AppsV1Api appsV1Api = new AppsV1Api(); + appsV1Api.setApiClient(COREV1_API.getApiClient()); + V1DeploymentList listNamespacedDeployment = + appsV1Api.listNamespacedDeployment( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + null, + Boolean.FALSE); + + List appsV1DeploymentItems = listNamespacedDeployment.getItems(); + Optional findedDeployment = + appsV1DeploymentItems.stream() + .filter( + (V1Deployment deployment) -> + deployment.getMetadata().getName().equals(deploymentName)) + .findFirst(); + findedDeployment.ifPresent( + (V1Deployment deploy) -> { + try { + V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); + V1Deployment newDeploy = deploy.spec(newSpec); + appsV1Api.replaceNamespacedDeployment( + deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); + } catch (ApiException ex) { + LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); + } + }); + } + + /** + * Print out the Log for specific Pods + * + * @param namespace + * @param podName + * @throws ApiException + */ + public static void printLog(String namespace, String podName) throws ApiException { + // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog + String readNamespacedPodLog = + COREV1_API.readNamespacedPodLog( + podName, + namespace, + null, + Boolean.FALSE, + null, + Integer.MAX_VALUE, + null, + Boolean.FALSE, + Integer.MAX_VALUE, + 40, + Boolean.FALSE); + System.out.println(readNamespacedPodLog); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java new file mode 100644 index 0000000000..8e48cc51b3 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.Arrays; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" + * + *

From inside $REPO_DIR/examples + */ +public class FluentExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .endContainer() + .endSpec() + .build(); + + api.createNamespacedPod("default", pod, null, null, null, null); + + V1Pod pod2 = + new V1Pod() + .metadata(new V1ObjectMeta().name("anotherpod")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); + + api.createNamespacedPod("default", pod2, null, null, null, null); + + V1PodList list = + api.listNamespacedPod( + "default", null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java new file mode 100644 index 0000000000..ddfb1243b8 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java @@ -0,0 +1,63 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.util.Arrays; + +public class GenericClientExample { + + public static void main(String[] args) throws Exception { + + // The following codes demonstrates using generic client to manipulate pods + V1Pod pod = + new V1Pod() + .metadata(new V1ObjectMeta().name("foo").namespace("default")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("c").image("test")))); + + ApiClient apiClient = ClientBuilder.standard().build(); + GenericKubernetesApi podClient = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + + V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); + System.out.println("Created!"); + + V1Pod patchedPod = + podClient + .patch( + "default", + "foo", + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) + .throwsApiException() + .getObject(); + System.out.println("Patched!"); + + V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); + if (deletedPod != null) { + System.out.println( + "Received after-deletion status of the requested object, will be deleting in background!"); + } + System.out.println("Deleted!"); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java new file mode 100644 index 0000000000..7ab705b440 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import java.io.IOException; + +/** + * A simple example of how to use the Java API inside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class InClusterClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // loading the in-cluster config, including: + // 1. service-account CA + // 2. service-account bearer-token + // 3. service-account namespace + // 4. master endpoints(ip, port) from pre-set environment variables + ApiClient client = ClientBuilder.cluster().build(); + + // if you prefer not to refresh service account token, please use: + // ApiClient client = ClientBuilder.oldCluster().build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java new file mode 100644 index 0000000000..bae1ef3595 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java @@ -0,0 +1,106 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.informer.ResourceEventHandler; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.CallGeneratorParams; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" + * + *

From inside $REPO_DIR/examples + */ +public class InformerExample { + public static void main(String[] args) throws Exception { + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + SharedInformerFactory factory = new SharedInformerFactory(apiClient); + + // Node informer + SharedIndexInformer nodeInformer = + factory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + // **NOTE**: + // The following "CallGeneratorParams" lambda merely generates a stateless + // HTTPs requests, the effective apiClient is the one specified when constructing + // the informer-factory. + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + + nodeInformer.addEventHandler( + new ResourceEventHandler() { + @Override + public void onAdd(V1Node node) { + System.out.printf("%s node added!\n", node.getMetadata().getName()); + } + + @Override + public void onUpdate(V1Node oldNode, V1Node newNode) { + System.out.printf( + "%s => %s node updated!\n", + oldNode.getMetadata().getName(), newNode.getMetadata().getName()); + } + + @Override + public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { + System.out.printf("%s node deleted!\n", node.getMetadata().getName()); + } + }); + + factory.startAllRegisteredInformers(); + + V1Node nodeToCreate = new V1Node(); + V1ObjectMeta metadata = new V1ObjectMeta(); + metadata.setName("noxu"); + nodeToCreate.setMetadata(metadata); + V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); + Thread.sleep(3000); + + Lister nodeLister = new Lister(nodeInformer.getIndexer()); + V1Node node = nodeLister.get("noxu"); + System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); + factory.stopAllRegisteredInformers(); + Thread.sleep(3000); + System.out.println("informer stopped.."); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java new file mode 100644 index 0000000000..c4b15401b0 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.KubeConfig; +import java.io.FileReader; +import java.io.IOException; + +/** + * A simple example of how to use the Java API from an application outside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class KubeConfigFileClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // file path to your KubeConfig + + String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; + + // loading the out-of-cluster config, a kubeconfig from file-system + ApiClient client = + ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java new file mode 100644 index 0000000000..2619c9f271 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java @@ -0,0 +1,311 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; +import static io.kubernetes.client.extended.kubectl.Kubectl.copy; +import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.delete; +import static io.kubernetes.client.extended.kubectl.Kubectl.drain; +import static io.kubernetes.client.extended.kubectl.Kubectl.exec; +import static io.kubernetes.client.extended.kubectl.Kubectl.label; +import static io.kubernetes.client.extended.kubectl.Kubectl.log; +import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; +import static io.kubernetes.client.extended.kubectl.Kubectl.scale; +import static io.kubernetes.client.extended.kubectl.Kubectl.taint; +import static io.kubernetes.client.extended.kubectl.Kubectl.top; +import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.version; +import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; + +import io.kubernetes.client.common.KubernetesObject; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.extended.kubectl.KubectlExec; +import io.kubernetes.client.extended.kubectl.KubectlPortForward; +import io.kubernetes.client.extended.kubectl.exception.KubectlException; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1ReplicationController; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.tuple.Pair; + +/** + * A Java equivalent for the kubectl command line tool. Not nearly as complete. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" + * + *

From inside $REPO_DIR/examples + */ +public class KubectlExample { + static Class getClassForKind(String kind) { + switch (kind) { + case "pod": + case "pods": + return V1Pod.class; + case "deployment": + case "deployments": + return V1Deployment.class; + case "service": + case "services": + return V1Service.class; + case "node": + case "nodes": + return V1Node.class; + case "replicationcontroller": + case "replicationcontrollers": + return V1ReplicationController.class; + } + return null; + } + + private static final String PADDING = " "; + + private static String pad(String value) { + while (value.length() < PADDING.length()) { + value += " "; + } + return value; + } + + public static void main(String[] args) + throws java.io.IOException, KubectlException, ParseException { + ApiClient client = Config.defaultClient(); + + Options options = new Options(); + options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); + options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); + options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); + DefaultParser parser = new DefaultParser(); + CommandLine cli = parser.parse(options, args); + + args = cli.getArgs(); + String verb = args[0]; + String ns = cli.getOptionValue("n", "default"); + String kind = null; + String name = null; + + switch (verb) { + case "delete": + kind = args[1]; + name = args[2]; + delete(getClassForKind(kind)).namespace(ns).name(name).execute(); + case "drain": + name = args[1]; + drain().apiClient(client).name(name).execute(); + System.out.println("Node drained"); + System.exit(0); + case "cordon": + name = args[1]; + cordon().apiClient(client).name(name).execute(); + System.out.println("Node cordoned"); + System.exit(0); + case "uncordon": + name = args[1]; + uncordon().apiClient(client).name(name).execute(); + System.out.println("Node uncordoned"); + System.exit(0); + case "top": + String what = args[1]; + switch (what) { + case "nodes": + case "node": + List> nodes = + top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); + System.out.println(pad("Node") + "\tCPU\t\tMemory"); + for (Pair node : nodes) { + System.out.println( + pad(node.getLeft().getMetadata().getName()) + + "\t" + + node.getRight().getUsage().get("cpu").getNumber() + + "\t" + + node.getRight().getUsage().get("memory").getNumber()); + } + System.exit(0); + case "pods": + case "pod": + List> pods = + top(V1Pod.class, PodMetrics.class) + .apiClient(client) + .namespace(ns) + .metric("cpu") + .execute(); + System.out.println(pad("Pod") + "\tCPU\t\tMemory"); + for (Pair pod : pods) { + System.out.println( + pad(pod.getLeft().getMetadata().getName()) + + "\t" + + podMetricSum(pod.getRight(), "cpu") + + "\t" + + podMetricSum(pod.getRight(), "memory")); + } + System.exit(0); + } + System.err.println("Unknown top argument: " + what); + System.exit(-1); + case "cp": + String from = args[1]; + String to = args[2]; + if (from.indexOf(":") != -1) { + String[] parts = from.split(":"); + name = parts[0]; + from = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .fromPod(from) + .to(to) + .execute(); + } else if (to.indexOf(":") != -1) { + String[] parts = to.split(":"); + name = parts[0]; + to = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .from(from) + .toPod(to) + .execute(); + } else { + System.err.println("Missing pod name for copy."); + System.exit(-1); + } + System.out.println("Copied " + from + " -> " + to); + System.exit(0); + case "taint": + name = args[1]; + String taintSpec = args[2]; + boolean remove = taintSpec.endsWith("-"); + int ix = taintSpec.indexOf("="); + int ix2 = taintSpec.indexOf(":"); + + if (remove) { + taintSpec = taintSpec.substring(0, taintSpec.length() - 2); + String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); + String effect = ix == -1 ? null : taintSpec.substring(ix + 1); + + if (effect == null) { + taint().apiClient(client).name(name).removeTaint(key).execute(); + } else { + taint().apiClient(client).name(name).removeTaint(key, effect).execute(); + } + System.exit(0); + } + if (ix2 == -1) { + System.err.println("key:effect or key=value:effect is required."); + System.exit(-1); + } + String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); + String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); + String effect = taintSpec.substring(ix2 + 1); + + if (value == null) { + taint().apiClient(client).name(name).addTaint(key, effect).execute(); + } else { + taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); + } + System.exit(0); + case "portforward": + name = args[1]; + KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); + for (int i = 2; i < args.length; i++) { + String port = args[i]; + String[] ports = port.split(":"); + System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); + forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); + } + forward.execute(); + System.exit(0); + case "log": + name = args[1]; + Streams.copy( + log() + .apiClient(client) + .name(name) + .namespace(ns) + .container(cli.getOptionValue("c", "")) + .execute(), + System.out); + System.exit(0); + case "scale": + kind = args[1]; + name = args[2]; + if (!cli.hasOption("r")) { + System.err.println("--replicas is required"); + System.exit(-3); + } + int replicas = Integer.parseInt(cli.getOptionValue("r")); + scale(getClassForKind(kind)) + .apiClient(client) + .namespace(ns) + .name(name) + .replicas(replicas) + .execute(); + System.out.println("Deployment scaled."); + System.exit(0); + case "version": + System.out.println(version().apiClient(client)); + System.exit(0); + case "label": + kind = args[1]; + name = args[2]; + String labelKey = args[3]; + String labelValue = args[4]; + Class clazz = getClassForKind(kind); + if (clazz == null) { + System.err.println("Unknown kind: " + kind); + System.exit(-2); + } + label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); + System.exit(0); + case "exec": + name = args[1]; + String[] command = Arrays.copyOfRange(args, 2, args.length); + KubectlExec e = + exec() + .apiClient(client) + .namespace(ns) + .name(name) + .command(command) + .container(cli.getOptionValue("c", "")); + System.exit(e.execute()); + case "api-resources": + apiResources().apiClient(client).execute().stream() + .forEach( + r -> + System.out.printf( + "%s\t\t%s\t\t%s\t\t%s\n", + r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); + System.exit(0); + default: + System.out.println("Unknown verb: " + verb); + System.exit(-1); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java new file mode 100644 index 0000000000..0e48689602 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.time.Duration; +import java.util.UUID; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" + * + *

From inside $REPO_DIR/examples + */ +public class LeaderElectionExample { + public static void main(String[] args) throws Exception { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // New + String appNamespace = "default"; + String appName = "leader-election-foobar"; + String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique + EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); + + LeaderElectionConfig leaderElectionConfig = + new LeaderElectionConfig( + lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); + try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { + leaderElector.run( + () -> { + System.out.println("Do something when getting leadership."); + }, + () -> { + System.out.println("Do something when losing leadership."); + }); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java new file mode 100644 index 0000000000..dbfa157eea --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PodLogs; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.io.InputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" + * + *

From inside $REPO_DIR/examples + */ +public class LogsExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + CoreV1Api coreApi = new CoreV1Api(client); + + PodLogs logs = new PodLogs(); + V1Pod pod = + coreApi + .listNamespacedPod( + "default", "false", null, null, null, null, null, null, null, null, null) + .getItems() + .get(0); + + InputStream is = logs.streamNamespacedPodLog(pod); + Streams.copy(is, System.out); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java new file mode 100644 index 0000000000..0d8c10e30b --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Metrics; +import io.kubernetes.client.custom.ContainerMetrics; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.NodeMetricsList; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" + * + *

From inside $REPO_DIR/examples + */ +public class MetricsExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Metrics metrics = new Metrics(client); + NodeMetricsList list = metrics.getNodeMetrics(); + for (NodeMetrics item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + for (String key : item.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + item.getUsage().get(key)); + } + System.out.println(); + } + + for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + if (item.getContainers() == null) { + continue; + } + for (ContainerMetrics container : item.getContainers()) { + System.out.println(container.getName()); + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + for (String key : container.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + container.getUsage().get(key)); + } + System.out.println(); + } + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java new file mode 100644 index 0000000000..b0a4ac4fa4 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java @@ -0,0 +1,72 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.pager.Pager; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" + * + *

From inside $REPO_DIR/examples + */ +public class PagerExample { + public static void main(String[] args) throws IOException { + + ApiClient client = Config.defaultClient(); + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + CoreV1Api api = new CoreV1Api(); + int i = 0; + Pager pager = + new Pager( + (Pager.PagerParams param) -> { + try { + return api.listNamespaceCall( + null, + null, + param.getContinueToken(), + null, + null, + param.getLimit(), + null, + null, + 1, + null, + null); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, + client, + 10, + V1NamespaceList.class); + for (V1Namespace namespace : pager) { + System.out.println(namespace.getMetadata().getName()); + } + System.out.println("------------------"); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java new file mode 100644 index 0000000000..92866a46fe --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" + * + *

From inside $REPO_DIR/examples + */ +public class ParseExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + if (args.length < 2) { + System.err.println("Usage: ParseExample "); + System.exit(1); + } + ApiClient client = Config.defaultClient(); + FileReader json = new FileReader(args[0]); + Object obj = + client + .getJSON() + .getGson() + .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); + + String output = client.getJSON().getGson().toJson(obj); + + // Test round tripping... + Object obj2 = + client + .getJSON() + .getGson() + .fromJson( + new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); + + String output2 = client.getJSON().getGson().toJson(obj2); + + // Validate round trip + if (!output.equals(output2)) { + System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); + System.exit(2); + } + + System.out.println(output); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java new file mode 100644 index 0000000000..8f1d123978 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java @@ -0,0 +1,129 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.PatchUtils; +import java.io.IOException; + +/** + * A simple Example of how to use the Java API.
+ * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
+ * For generating Json Patches, refer http://jsonpatch.com. For + * generating Strategic Merge Patches, refer strategic-merge-patch.md. + * + *

    + *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a + * finalizer. + *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. + *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. + *
+ * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" + * + *

From inside $REPO_DIR/examples + */ +public class PatchExample { + static String jsonPatchStr = + "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; + static String strategicMergePatchStr = + "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; + static String jsonDeploymentStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + static String applyYamlStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + + public static void main(String[] args) throws IOException { + try { + AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); + V1Deployment body = + Configuration.getDefaultApiClient() + .getJSON() + .deserialize(jsonDeploymentStr, V1Deployment.class); + + // create a deployment + V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null); + System.out.println("original deployment" + deploy1); + + // json-patch a deployment + V1Deployment deploy2 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(jsonPatchStr), + null, + null, + null, // field-manager is optional + null, + null, + null), + V1Patch.PATCH_FORMAT_JSON_PATCH, + api.getApiClient()); + System.out.println("json-patched deployment" + deploy2); + + // strategic-merge-patch a deployment + V1Deployment deploy3 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(strategicMergePatchStr), + null, + null, + null, // field-manager is optional + null, + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + api.getApiClient()); + System.out.println("strategic-merge-patched deployment" + deploy3); + + // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 + // or opt-in by turning on the feature gate for v1.14 or v1.15. + // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply + V1Deployment deploy4 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(applyYamlStr), + null, + null, + "example-field-manager", // field-manager is required for server-side apply + null, + true, + null), + V1Patch.PATCH_FORMAT_APPLY_YAML, + api.getApiClient()); + System.out.println("application/apply-patch+yaml deployment" + deploy4); + + } catch (ApiException e) { + System.out.println(e.getResponseBody()); + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java new file mode 100644 index 0000000000..cbe064db31 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PortForward; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.ArrayList; +import java.util.List; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside + * $REPO_DIR/examples + * + *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times + * out pretty fast...) + */ +public class PortForwardExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + PortForward forward = new PortForward(); + List ports = new ArrayList<>(); + int localPort = 8080; + int targetPort = 8080; + ports.add(targetPort); + final PortForward.PortForwardResult result = + forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); + System.out.println("Forwarding!"); + ServerSocket ss = new ServerSocket(localPort); + + final Socket s = ss.accept(); + System.out.println("Connected!"); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + + System.exit(0); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java new file mode 100644 index 0000000000..65f38b8ce4 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java @@ -0,0 +1,43 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.coreos.monitoring.models.V1Prometheus; +import com.coreos.monitoring.models.V1PrometheusList; +import com.coreos.monitoring.models.V1PrometheusSpec; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +public class PromOpExample { + public static void main(String[] args) throws IOException, ApiException { + GenericKubernetesApi prometheusApi = + new GenericKubernetesApi<>( + V1Prometheus.class, + V1PrometheusList.class, + "monitoring.coreos.com", + "v1", + "prometheuses", + ClientBuilder.defaultClient()); + prometheusApi + .create( + new V1Prometheus() + .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) + .kind("Prometheus") + .apiVersion("monitoring.coreos.com/v1") + .spec(new V1PrometheusSpec())) + .throwsApiException(); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java new file mode 100644 index 0000000000..d2afb10142 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java @@ -0,0 +1,66 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.monitoring.Monitoring; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API with Prometheus metrics + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" + * + *

From inside $REPO_DIR/examples + */ +public class PrometheusExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // Install an HTTP Interceptor that adds metrics + Monitoring.installMetrics(client); + + // Install a simple HTTP server to serve prometheus metrics. If you already are serving + // metrics elsewhere, this is unnecessary. + Monitoring.startMetricsServer("localhost", 8080); + + CoreV1Api api = new CoreV1Api(); + + while (true) { + // A request that should return 200 + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + // A request that should return 404 + try { + V1Pod pod = api.readNamespacedPod("foo", "bar", null); + } catch (ApiException ex) { + if (ex.getCode() != 404) { + throw ex; + } + } + try { + Thread.sleep(10000); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java new file mode 100644 index 0000000000..e4e05a2aa1 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java @@ -0,0 +1,69 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.ProtoClient; +import io.kubernetes.client.ProtoClient.ObjectOrStatus; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.proto.Meta.ObjectMeta; +import io.kubernetes.client.proto.V1.Namespace; +import io.kubernetes.client.proto.V1.NamespaceSpec; +import io.kubernetes.client.proto.V1.Pod; +import io.kubernetes.client.proto.V1.PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" + * + *

From inside $REPO_DIR/examples + */ +public class ProtoExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + ProtoClient pc = new ProtoClient(client); + ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); + + if (list.object.getItemsCount() > 0) { + Pod p = list.object.getItems(0); + System.out.println(p); + } + + Namespace namespace = + Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); + + ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); + System.out.println(ns); + if (ns.object != null) { + namespace = + ns.object + .toBuilder() + .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) + .build(); + // This is how you would update an object, but you can't actually + // update namespaces, so this returns a 405 + ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); + System.out.println(ns.status); + } + + ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); + System.out.println(ns); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java new file mode 100644 index 0000000000..f6494a836e --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.openapi.models.V1EndpointsList; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.time.Duration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + +@SpringBootApplication +public class SpringControllerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringControllerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner commandLineRunner( + SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("running controller.."); + nodePrintingController.run(); + }; + } + + @Bean + public Controller nodePrintingController( + SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { + DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); + builder = + builder.watch( + (q) -> { + return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) + .withResyncPeriod(Duration.ofMinutes(1)) + .build(); + }); + builder.withWorkerCount(2); + builder.withReadyFunc(reconciler::informerReady); + return builder.withReconciler(reconciler).withName("nodePrintingController").build(); + } + + @Bean + public SharedIndexInformer endpointsInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>( + V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); + } + + @Bean + public SharedIndexInformer nodeInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); + } + + @Bean + public SharedIndexInformer podInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); + } + } + + @Component + public static class NodePrintingReconciler implements Reconciler { + + @Value("${namespace}") + private String namespace; + + private SharedInformer nodeInformer; + + private SharedInformer podInformer; + + private Lister nodeLister; + + private Lister podLister; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { + this.nodeInformer = nodeInformer; + this.podInformer = podInformer; + this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); + this.podLister = new Lister<>(podInformer.getIndexer(), namespace); + } + + // *OPTIONAL* + // If you want to hold the controller from running util some condition.. + public boolean informerReady() { + return podInformer.hasSynced() && nodeInformer.hasSynced(); + } + + @Override + public Result reconcile(Request request) { + V1Node node = nodeLister.get(request.getName()); + + System.out.println("get all pods in namespace " + namespace); + podLister.namespace(namespace).list().stream() + .map(pod -> pod.getMetadata().getName()) + .forEach(System.out::println); + + System.out.println("triggered reconciling " + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java new file mode 100644 index 0000000000..bafe11e421 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.network.EndpointsLoadBalancer; +import io.kubernetes.client.extended.network.LoadBalancer; +import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class SpringLoadBalancerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringLoadBalancerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner loadBalancerCommandLineRunner( + SharedInformerFactory sharedInformerFactory, MyService myService) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("routing default/kubernetes:"); + System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); + }; + } + + @Bean + public MyService myService(SharedIndexInformer lister) { + return new MyService(new Lister<>(lister.getIndexer())); + } + } + + public static class MyService { + + private LoadBalancer defaultKubernetesLoadBalancer; + + public MyService(Lister lister) { + InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); + RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); + defaultKubernetesLoadBalancer = + new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java new file mode 100644 index 0000000000..c32a74afd4 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java @@ -0,0 +1,54 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.google.gson.reflect.TypeToken; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Watch; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** A simple example of how to use Watch API to watch changes in Namespace list. */ +public class WatchExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + // infinite timeout + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + Watch watch = + Watch.createWatch( + client, + api.listNamespaceCall( + null, null, null, null, null, 5, null, null, null, Boolean.TRUE, null), + new TypeToken>() {}.getType()); + + try { + for (Watch.Response item : watch) { + System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); + } + } finally { + watch.close(); + } + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java new file mode 100644 index 0000000000..e1f54dcd07 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java @@ -0,0 +1,74 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.WebSockets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import okhttp3.WebSocket; + +/** + * This is a pretty low level, most people won't need to use WebSockets directly. + * + *

If you do need to run it, you can run: mvn exec:java \ + * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ + * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true + * + *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP + * GET calls. + */ +public class WebSocketsExample { + public static void main(String... args) throws ApiException, IOException { + final ApiClient client = Config.defaultClient(); + WebSockets.stream( + args[0], + "GET", + client, + new WebSockets.SocketListener() { + private volatile WebSocket socket; + + @Override + public void open(String protocol, WebSocket socket) { + this.socket = socket; + } + + @Override + public void close() {} + + @Override + public void bytesMessage(InputStream is) {} + + @Override + public void failure(Throwable t) { + t.printStackTrace(); + } + + @Override + public void textMessage(Reader in) { + try { + BufferedReader reader = new BufferedReader(in); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + System.out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + } +} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java new file mode 100644 index 0000000000..67b5536ab9 --- /dev/null +++ b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java @@ -0,0 +1,109 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.IntOrString; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.openapi.models.V1ServiceBuilder; +import io.kubernetes.client.openapi.models.V1Status; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Yaml; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" + * + *

From inside $REPO_DIR/examples + */ +public class YamlExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .withNewResources() + .withLimits(new HashMap<>()) + .endResources() + .endContainer() + .endSpec() + .build(); + System.out.println(Yaml.dump(pod)); + + V1Service svc = + new V1ServiceBuilder() + .withNewMetadata() + .withName("aservice") + .endMetadata() + .withNewSpec() + .withSessionAffinity("ClientIP") + .withType("NodePort") + .addNewPort() + .withProtocol("TCP") + .withName("client") + .withPort(8008) + .withNodePort(8080) + .withTargetPort(new IntOrString(8080)) + .endPort() + .endSpec() + .build(); + System.out.println(Yaml.dump(svc)); + + // Read yaml configuration file, and deploy it + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // See issue #474. Not needed at most cases, but it is needed if you are using war + // packging or running this on JUnit. + Yaml.addModelMap("v1", "Service", V1Service.class); + + // Example yaml file can be found in $REPO_DIR/test-svc.yaml + File file = new File("test-svc.yaml"); + V1Service yamlSvc = (V1Service) Yaml.load(file); + + // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of + // CoreV1API + CoreV1Api api = new CoreV1Api(); + V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null); + + System.out.println(createResult); + + V1Service deleteResult = + api.deleteNamespacedService( + yamlSvc.getMetadata().getName(), + "default", + null, + null, + null, + null, + null, + new V1DeleteOptions()); + System.out.println(deleteResult); + } +} diff --git a/examples/examples-release-16/src/main/resources/application.properties b/examples/examples-release-16/src/main/resources/application.properties new file mode 100644 index 0000000000..dc886e5f48 --- /dev/null +++ b/examples/examples-release-16/src/main/resources/application.properties @@ -0,0 +1,2 @@ +namespace=airflow +management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java new file mode 100644 index 0000000000..df2f168e41 --- /dev/null +++ b/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.junit.Assert.assertEquals; + +import com.github.tomakehurst.wiremock.junit.WireMockRule; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; + +public class ExampleTest { + private static final int PORT = 8089; + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); + + @Test + public void exactUrlOnly() throws IOException, ApiException { + ApiClient client = new ApiClient(); + client.setBasePath("http://localhost:" + PORT); + Configuration.setDefaultApiClient(client); + + V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); + + stubFor( + get(urlEqualTo("/api/v1/namespaces/name")) + .willReturn( + aResponse() + .withHeader("Content-Type", "application/json") + .withBody(client.getJSON().serialize(ns1)))); + + CoreV1Api api = new CoreV1Api(); + V1Namespace ns2 = api.readNamespace("name", null); + assertEquals(ns1, ns2); + } +} diff --git a/examples/examples-release-16/test-svc.yaml b/examples/examples-release-16/test-svc.yaml new file mode 100644 index 0000000000..f225bea76f --- /dev/null +++ b/examples/examples-release-16/test-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: test-service +spec: + type: ClusterIP + selector: + app: test-service + ports: + - name: port-of-container + port: 8080 \ No newline at end of file diff --git a/examples/examples-release-16/test.yaml b/examples/examples-release-16/test.yaml new file mode 100644 index 0000000000..0b46e57003 --- /dev/null +++ b/examples/examples-release-16/test.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: test +spec: + replicas: 1 + template: + metadata: + labels: + app: test + spec: + containers: + - name: test + image: test/examples:1.0 + command: ["/bin/sh","-c"] + args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-17/Dockerfile b/examples/examples-release-17/Dockerfile new file mode 100644 index 0000000000..ac90eb1d67 --- /dev/null +++ b/examples/examples-release-17/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-jre + +COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar + +CMD ["java", "-jar", "/examples.jar"] + + diff --git a/examples/examples-release-17/README.md b/examples/examples-release-17/README.md new file mode 100644 index 0000000000..c6e02e41fd --- /dev/null +++ b/examples/examples-release-17/README.md @@ -0,0 +1,13 @@ +# Running examples + +```sh +export REPO_ROOT=/path/to/client-java/repo + +cd ${REPO_ROOT}/ +mvn install + +cd ${REPO_ROOT}/examples/examples-14 +mvn compile +mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" +``` + diff --git a/examples/examples-release-17/createPod.sh b/examples/examples-release-17/createPod.sh new file mode 100755 index 0000000000..18a9841317 --- /dev/null +++ b/examples/examples-release-17/createPod.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# creates a pod and runs +# Example.java(list pods for all namespaces) on starting of pod + +# Exit on any error. +set -e + +if ! which minikube > /dev/null; then + echo "This script requires minikube installed." + exit 100 +fi + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +export REPO_ROOT=${dir}/.. + +cd ${REPO_ROOT} +mvn install + +cd ${REPO_ROOT}/examples +mvn package + +eval $(minikube docker-env) +docker build -t test/examples:1.0 . +kubectl apply -f test.yaml diff --git a/examples/examples-release-17/pom.xml b/examples/examples-release-17/pom.xml new file mode 100644 index 0000000000..186080c741 --- /dev/null +++ b/examples/examples-release-17/pom.xml @@ -0,0 +1,118 @@ + + 4.0.0 + + + io.kubernetes + client-java-examples-parent + 25.0.0-legacy-SNAPSHOT + .. + + + client-java-examples-release-17 + client-java-examples-release-17 + + + + ch.qos.logback + logback-classic + runtime + + + io.prometheus + simpleclient + 0.16.0 + + + io.prometheus + simpleclient_httpserver + 0.16.0 + + + io.kubernetes + client-java-api + 17.0.0 + + + io.kubernetes + client-java + 17.0.0 + + + io.kubernetes + client-java-extended + 17.0.0 + + + io.kubernetes + client-java-spring-integration + 17.0.0 + + + io.kubernetes + client-java-proto + 17.0.0 + + + commons-cli + commons-cli + + + io.kubernetes + client-java-cert-manager-models + 10.0.1 + + + io.kubernetes + client-java-prometheus-operator-models + 10.0.1 + + + + junit + junit + test + + + com.github.tomakehurst + wiremock + test + + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-actuator + ${spring.boot.version} + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + true + + + + + + \ No newline at end of file diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java new file mode 100644 index 0000000000..7f753b8d8f --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Attach; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" + * + *

From inside $REPO_DIR/examples + */ +public class AttachExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Attach attach = new Attach(); + final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); + + new Thread( + new Runnable() { + public void run() { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + OutputStream output = result.getStandardInputStream(); + try { + while (true) { + String line = in.readLine(); + output.write(line.getBytes()); + output.write('\n'); + output.flush(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getStandardOutputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + result.close(); + System.exit(0); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java new file mode 100644 index 0000000000..b616a18ee9 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; +import io.cert.manager.models.V1beta1Issuer; +import io.cert.manager.models.V1beta1IssuerList; +import io.cert.manager.models.V1beta1IssuerSpec; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +/** + * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a + * Kubernetes cluster where cert-manager is installed + */ +public class CertManagerExample { + public static void main(String[] args) throws IOException { + GenericKubernetesApi issuerApi = + new GenericKubernetesApi<>( + V1beta1Issuer.class, + V1beta1IssuerList.class, + "cert-manager.io", + "v1beta1", + "issuers", + ClientBuilder.defaultClient()); + issuerApi.create( + new V1beta1Issuer() + .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) + .kind("Issuer") + .apiVersion("cert-manager.io/v1beta1") + .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java new file mode 100644 index 0000000000..fed0e544d3 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java @@ -0,0 +1,163 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.ControllerManager; +import io.kubernetes.client.extended.controller.LeaderElectingController; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.extended.event.EventType; +import io.kubernetes.client.extended.event.legacy.EventBroadcaster; +import io.kubernetes.client.extended.event.legacy.EventRecorder; +import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1EventSource; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.util.CallGeneratorParams; +import java.io.IOException; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +public class ControllerExample { + public static void main(String[] args) throws IOException { + + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + // instantiating an informer-factory, and there should be only one informer-factory + // globally. + SharedInformerFactory informerFactory = new SharedInformerFactory(); + // registering node-informer into the informer-factory. + SharedIndexInformer nodeInformer = + informerFactory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + informerFactory.startAllRegisteredInformers(); + + EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); + + // nodeReconciler prints node information on events + NodePrintingReconciler nodeReconciler = + new NodePrintingReconciler( + nodeInformer, + eventBroadcaster.newRecorder( + new V1EventSource().host("localhost").component("node-printer"))); + + // Use builder library to construct a default controller. + Controller controller = + ControllerBuilder.defaultBuilder(informerFactory) + .watch( + (workQueue) -> + ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) + .withWorkQueueKeyFunc( + (V1Node node) -> + new Request(node.getMetadata().getName())) // optional, default to + .withOnAddFilter( + (V1Node createdNode) -> + createdNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onAdd filter + .withOnUpdateFilter( + (V1Node oldNode, V1Node newNode) -> + newNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onUpdate filter + .withOnDeleteFilter( + (V1Node deletedNode, Boolean stateUnknown) -> + deletedNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onDelete filter + .build()) + .withReconciler(nodeReconciler) // required, set the actual reconciler + .withName("node-printing-controller") // optional, set name for controller + .withWorkerCount(4) // optional, set worker thread count + .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the + // cache has synced up + .build(); + + // Use builder library to manage one or multiple controllers. + ControllerManager controllerManager = + ControllerBuilder.controllerManagerBuilder(informerFactory) + .addController(controller) + .build(); + + LeaderElectingController leaderElectingController = + new LeaderElectingController( + new LeaderElector( + new LeaderElectionConfig( + new EndpointsLock("kube-system", "leader-election", "foo"), + Duration.ofMillis(10000), + Duration.ofMillis(8000), + Duration.ofMillis(5000))), + controllerManager); + + leaderElectingController.run(); + } + + static class NodePrintingReconciler implements Reconciler { + + private Lister nodeLister; + private EventRecorder eventRecorder; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, EventRecorder recorder) { + this.nodeLister = new Lister<>(nodeInformer.getIndexer()); + this.eventRecorder = recorder; + } + + @Override + public Result reconcile(Request request) { + V1Node node = this.nodeLister.get(request.getName()); + System.out.println("triggered reconciling " + node.getMetadata().getName()); + this.eventRecorder.event( + node, + EventType.Normal, + "Print Node", + "Successfully printed %s", + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java new file mode 100644 index 0000000000..bbb6575676 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Copy; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import io.kubernetes.client.util.exception.CopyNotSupportedException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" + * + *

From inside $REPO_DIR/examples + */ +public class CopyExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, CopyNotSupportedException { + String podName = "kube-addon-manager-minikube"; + String namespace = "kube-system"; + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Copy copy = new Copy(); + InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); + Streams.copy(dataStream, System.out); + + copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); + + System.out.println("Done!"); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java new file mode 100644 index 0000000000..b8cb04616d --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; +import java.io.IOException; + +public class DynamicClientExample { + + public static void main(String[] args) throws IOException, ApiException { + + ApiClient apiClient = ClientBuilder.standard().build(); + + // retrieving the latest state of the default namespace + DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); + DynamicKubernetesObject defaultNamespace = + dynamicApi.get("default").throwsApiException().getObject(); + + // attaching a "foo=bar" label to the default namespace + defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); + DynamicKubernetesObject updatedDefaultNamespace = + dynamicApi.update(defaultNamespace).throwsApiException().getObject(); + + System.out.println(updatedDefaultNamespace); + + apiClient.getHttpClient().connectionPool().evictAll(); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java new file mode 100644 index 0000000000..95d7fa51bc --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.Example" + * + *

From inside $REPO_DIR/examples + */ +public class Example { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java new file mode 100644 index 0000000000..acea8e815a --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Exec; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExecExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, ParseException { + final Options options = new Options(); + options.addOption(new Option("p", "pod", true, "The name of the pod")); + options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); + + CommandLineParser parser = new DefaultParser(); + CommandLine cmd = parser.parse(options, args); + + String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); + String namespace = cmd.getOptionValue("n", "default"); + args = cmd.getArgs(); + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Exec exec = new Exec(); + boolean tty = System.console() != null; + // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] + // {"sh", "-c", "echo foo"}, true, tty); + final Process proc = + exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); + + Thread in = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(System.in, proc.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + in.start(); + + Thread out = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(proc.getInputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + out.start(); + + proc.waitFor(); + + // wait for any last output; no need to wait for input thread + out.join(); + + proc.destroy(); + + System.exit(proc.exitValue()); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java new file mode 100644 index 0000000000..261323c512 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java @@ -0,0 +1,274 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentList; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1ServiceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExpandedExample { + + private static CoreV1Api COREV1_API; + private static final String DEFAULT_NAME_SPACE = "default"; + private static final Integer TIME_OUT_VALUE = 180; + private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); + + /** + * Main method + * + * @param args + */ + public static void main(String[] args) { + try { + ApiClient client = Config.defaultClient(); + // To change the context of k8s cluster, you can use + // io.kubernetes.client.util.KubeConfig + Configuration.setDefaultApiClient(client); + COREV1_API = new CoreV1Api(client); + + // ScaleUp/ScaleDown the Deployment pod + // Please change the name of Deployment? + System.out.println("----- Scale Deployment Start -----"); + scaleDeployment("account-service", 5); + + // List all of the namespaces and pods + List nameSpaces = getAllNameSpaces(); + nameSpaces.stream() + .forEach( + namespace -> { + try { + System.out.println("----- " + namespace + " -----"); + getNamespacedPod(namespace).stream().forEach(System.out::println); + } catch (ApiException ex) { + LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); + } + }); + + // Print all of the Services + System.out.println("----- Print list all Services Start -----"); + List services = getServices(); + services.stream().forEach(System.out::println); + System.out.println("----- Print list all Services End -----"); + + // Print log of specific pod. In this example show the first pod logs. + System.out.println("----- Print Log of Specific Pod Start -----"); + String firstPodName = getPods().get(0); + printLog(DEFAULT_NAME_SPACE, firstPodName); + System.out.println("----- Print Log of Specific Pod End -----"); + } catch (ApiException | IOException ex) { + LOGGER.warn("Exception had occured ", ex); + } + } + + /** + * Get all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getAllNameSpaces() throws ApiException { + V1NamespaceList listNamespace = + COREV1_API.listNamespace( + "true", null, null, null, null, 0, null, null, Integer.MAX_VALUE, Boolean.FALSE); + List list = + listNamespace.getItems().stream() + .map(v1Namespace -> v1Namespace.getMetadata().getName()) + .collect(Collectors.toList()); + return list; + } + + /** + * List all pod names in all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getPods() throws ApiException { + V1PodList v1podList = + COREV1_API.listPodForAllNamespaces( + null, null, null, null, null, null, null, null, null, null); + List podList = + v1podList.getItems().stream() + .map(v1Pod -> v1Pod.getMetadata().getName()) + .collect(Collectors.toList()); + return podList; + } + + /** + * List all pod in the default namespace + * + * @return + * @throws ApiException + */ + public static List getNamespacedPod() throws ApiException { + return getNamespacedPod(DEFAULT_NAME_SPACE, null); + } + + /** + * List pod in specific namespace + * + * @param namespace + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace) throws ApiException { + return getNamespacedPod(namespace, null); + } + + /** + * List pod in specific namespace with label + * + * @param namespace + * @param label + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace, String label) throws ApiException { + V1PodList listNamespacedPod = + COREV1_API.listNamespacedPod( + namespace, + null, + null, + null, + null, + label, + Integer.MAX_VALUE, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + List listPods = + listNamespacedPod.getItems().stream() + .map(v1pod -> v1pod.getMetadata().getName()) + .collect(Collectors.toList()); + return listPods; + } + + /** + * List all Services in default namespace + * + * @return + * @throws ApiException + */ + public static List getServices() throws ApiException { + V1ServiceList listNamespacedService = + COREV1_API.listNamespacedService( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + Integer.MAX_VALUE, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + return listNamespacedService.getItems().stream() + .map(v1service -> v1service.getMetadata().getName()) + .collect(Collectors.toList()); + } + + /** + * Scale up/down the number of pod in Deployment + * + * @param deploymentName + * @param numberOfReplicas + * @throws ApiException + */ + public static void scaleDeployment(String deploymentName, int numberOfReplicas) + throws ApiException { + AppsV1Api appsV1Api = new AppsV1Api(); + appsV1Api.setApiClient(COREV1_API.getApiClient()); + V1DeploymentList listNamespacedDeployment = + appsV1Api.listNamespacedDeployment( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + null, + Boolean.FALSE); + + List appsV1DeploymentItems = listNamespacedDeployment.getItems(); + Optional findedDeployment = + appsV1DeploymentItems.stream() + .filter( + (V1Deployment deployment) -> + deployment.getMetadata().getName().equals(deploymentName)) + .findFirst(); + findedDeployment.ifPresent( + (V1Deployment deploy) -> { + try { + V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); + V1Deployment newDeploy = deploy.spec(newSpec); + appsV1Api.replaceNamespacedDeployment( + deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); + } catch (ApiException ex) { + LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); + } + }); + } + + /** + * Print out the Log for specific Pods + * + * @param namespace + * @param podName + * @throws ApiException + */ + public static void printLog(String namespace, String podName) throws ApiException { + // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog + String readNamespacedPodLog = + COREV1_API.readNamespacedPodLog( + podName, + namespace, + null, + Boolean.FALSE, + null, + Integer.MAX_VALUE, + null, + Boolean.FALSE, + Integer.MAX_VALUE, + 40, + Boolean.FALSE); + System.out.println(readNamespacedPodLog); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java new file mode 100644 index 0000000000..8e48cc51b3 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.Arrays; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" + * + *

From inside $REPO_DIR/examples + */ +public class FluentExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .endContainer() + .endSpec() + .build(); + + api.createNamespacedPod("default", pod, null, null, null, null); + + V1Pod pod2 = + new V1Pod() + .metadata(new V1ObjectMeta().name("anotherpod")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); + + api.createNamespacedPod("default", pod2, null, null, null, null); + + V1PodList list = + api.listNamespacedPod( + "default", null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java new file mode 100644 index 0000000000..ddfb1243b8 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java @@ -0,0 +1,63 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.util.Arrays; + +public class GenericClientExample { + + public static void main(String[] args) throws Exception { + + // The following codes demonstrates using generic client to manipulate pods + V1Pod pod = + new V1Pod() + .metadata(new V1ObjectMeta().name("foo").namespace("default")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("c").image("test")))); + + ApiClient apiClient = ClientBuilder.standard().build(); + GenericKubernetesApi podClient = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + + V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); + System.out.println("Created!"); + + V1Pod patchedPod = + podClient + .patch( + "default", + "foo", + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) + .throwsApiException() + .getObject(); + System.out.println("Patched!"); + + V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); + if (deletedPod != null) { + System.out.println( + "Received after-deletion status of the requested object, will be deleting in background!"); + } + System.out.println("Deleted!"); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java new file mode 100644 index 0000000000..7ab705b440 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import java.io.IOException; + +/** + * A simple example of how to use the Java API inside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class InClusterClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // loading the in-cluster config, including: + // 1. service-account CA + // 2. service-account bearer-token + // 3. service-account namespace + // 4. master endpoints(ip, port) from pre-set environment variables + ApiClient client = ClientBuilder.cluster().build(); + + // if you prefer not to refresh service account token, please use: + // ApiClient client = ClientBuilder.oldCluster().build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java new file mode 100644 index 0000000000..bae1ef3595 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java @@ -0,0 +1,106 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.informer.ResourceEventHandler; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.CallGeneratorParams; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" + * + *

From inside $REPO_DIR/examples + */ +public class InformerExample { + public static void main(String[] args) throws Exception { + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + SharedInformerFactory factory = new SharedInformerFactory(apiClient); + + // Node informer + SharedIndexInformer nodeInformer = + factory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + // **NOTE**: + // The following "CallGeneratorParams" lambda merely generates a stateless + // HTTPs requests, the effective apiClient is the one specified when constructing + // the informer-factory. + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + + nodeInformer.addEventHandler( + new ResourceEventHandler() { + @Override + public void onAdd(V1Node node) { + System.out.printf("%s node added!\n", node.getMetadata().getName()); + } + + @Override + public void onUpdate(V1Node oldNode, V1Node newNode) { + System.out.printf( + "%s => %s node updated!\n", + oldNode.getMetadata().getName(), newNode.getMetadata().getName()); + } + + @Override + public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { + System.out.printf("%s node deleted!\n", node.getMetadata().getName()); + } + }); + + factory.startAllRegisteredInformers(); + + V1Node nodeToCreate = new V1Node(); + V1ObjectMeta metadata = new V1ObjectMeta(); + metadata.setName("noxu"); + nodeToCreate.setMetadata(metadata); + V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); + Thread.sleep(3000); + + Lister nodeLister = new Lister(nodeInformer.getIndexer()); + V1Node node = nodeLister.get("noxu"); + System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); + factory.stopAllRegisteredInformers(); + Thread.sleep(3000); + System.out.println("informer stopped.."); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java new file mode 100644 index 0000000000..c4b15401b0 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.KubeConfig; +import java.io.FileReader; +import java.io.IOException; + +/** + * A simple example of how to use the Java API from an application outside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class KubeConfigFileClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // file path to your KubeConfig + + String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; + + // loading the out-of-cluster config, a kubeconfig from file-system + ApiClient client = + ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java new file mode 100644 index 0000000000..2619c9f271 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java @@ -0,0 +1,311 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; +import static io.kubernetes.client.extended.kubectl.Kubectl.copy; +import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.delete; +import static io.kubernetes.client.extended.kubectl.Kubectl.drain; +import static io.kubernetes.client.extended.kubectl.Kubectl.exec; +import static io.kubernetes.client.extended.kubectl.Kubectl.label; +import static io.kubernetes.client.extended.kubectl.Kubectl.log; +import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; +import static io.kubernetes.client.extended.kubectl.Kubectl.scale; +import static io.kubernetes.client.extended.kubectl.Kubectl.taint; +import static io.kubernetes.client.extended.kubectl.Kubectl.top; +import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.version; +import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; + +import io.kubernetes.client.common.KubernetesObject; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.extended.kubectl.KubectlExec; +import io.kubernetes.client.extended.kubectl.KubectlPortForward; +import io.kubernetes.client.extended.kubectl.exception.KubectlException; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1ReplicationController; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.tuple.Pair; + +/** + * A Java equivalent for the kubectl command line tool. Not nearly as complete. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" + * + *

From inside $REPO_DIR/examples + */ +public class KubectlExample { + static Class getClassForKind(String kind) { + switch (kind) { + case "pod": + case "pods": + return V1Pod.class; + case "deployment": + case "deployments": + return V1Deployment.class; + case "service": + case "services": + return V1Service.class; + case "node": + case "nodes": + return V1Node.class; + case "replicationcontroller": + case "replicationcontrollers": + return V1ReplicationController.class; + } + return null; + } + + private static final String PADDING = " "; + + private static String pad(String value) { + while (value.length() < PADDING.length()) { + value += " "; + } + return value; + } + + public static void main(String[] args) + throws java.io.IOException, KubectlException, ParseException { + ApiClient client = Config.defaultClient(); + + Options options = new Options(); + options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); + options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); + options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); + DefaultParser parser = new DefaultParser(); + CommandLine cli = parser.parse(options, args); + + args = cli.getArgs(); + String verb = args[0]; + String ns = cli.getOptionValue("n", "default"); + String kind = null; + String name = null; + + switch (verb) { + case "delete": + kind = args[1]; + name = args[2]; + delete(getClassForKind(kind)).namespace(ns).name(name).execute(); + case "drain": + name = args[1]; + drain().apiClient(client).name(name).execute(); + System.out.println("Node drained"); + System.exit(0); + case "cordon": + name = args[1]; + cordon().apiClient(client).name(name).execute(); + System.out.println("Node cordoned"); + System.exit(0); + case "uncordon": + name = args[1]; + uncordon().apiClient(client).name(name).execute(); + System.out.println("Node uncordoned"); + System.exit(0); + case "top": + String what = args[1]; + switch (what) { + case "nodes": + case "node": + List> nodes = + top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); + System.out.println(pad("Node") + "\tCPU\t\tMemory"); + for (Pair node : nodes) { + System.out.println( + pad(node.getLeft().getMetadata().getName()) + + "\t" + + node.getRight().getUsage().get("cpu").getNumber() + + "\t" + + node.getRight().getUsage().get("memory").getNumber()); + } + System.exit(0); + case "pods": + case "pod": + List> pods = + top(V1Pod.class, PodMetrics.class) + .apiClient(client) + .namespace(ns) + .metric("cpu") + .execute(); + System.out.println(pad("Pod") + "\tCPU\t\tMemory"); + for (Pair pod : pods) { + System.out.println( + pad(pod.getLeft().getMetadata().getName()) + + "\t" + + podMetricSum(pod.getRight(), "cpu") + + "\t" + + podMetricSum(pod.getRight(), "memory")); + } + System.exit(0); + } + System.err.println("Unknown top argument: " + what); + System.exit(-1); + case "cp": + String from = args[1]; + String to = args[2]; + if (from.indexOf(":") != -1) { + String[] parts = from.split(":"); + name = parts[0]; + from = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .fromPod(from) + .to(to) + .execute(); + } else if (to.indexOf(":") != -1) { + String[] parts = to.split(":"); + name = parts[0]; + to = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .from(from) + .toPod(to) + .execute(); + } else { + System.err.println("Missing pod name for copy."); + System.exit(-1); + } + System.out.println("Copied " + from + " -> " + to); + System.exit(0); + case "taint": + name = args[1]; + String taintSpec = args[2]; + boolean remove = taintSpec.endsWith("-"); + int ix = taintSpec.indexOf("="); + int ix2 = taintSpec.indexOf(":"); + + if (remove) { + taintSpec = taintSpec.substring(0, taintSpec.length() - 2); + String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); + String effect = ix == -1 ? null : taintSpec.substring(ix + 1); + + if (effect == null) { + taint().apiClient(client).name(name).removeTaint(key).execute(); + } else { + taint().apiClient(client).name(name).removeTaint(key, effect).execute(); + } + System.exit(0); + } + if (ix2 == -1) { + System.err.println("key:effect or key=value:effect is required."); + System.exit(-1); + } + String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); + String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); + String effect = taintSpec.substring(ix2 + 1); + + if (value == null) { + taint().apiClient(client).name(name).addTaint(key, effect).execute(); + } else { + taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); + } + System.exit(0); + case "portforward": + name = args[1]; + KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); + for (int i = 2; i < args.length; i++) { + String port = args[i]; + String[] ports = port.split(":"); + System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); + forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); + } + forward.execute(); + System.exit(0); + case "log": + name = args[1]; + Streams.copy( + log() + .apiClient(client) + .name(name) + .namespace(ns) + .container(cli.getOptionValue("c", "")) + .execute(), + System.out); + System.exit(0); + case "scale": + kind = args[1]; + name = args[2]; + if (!cli.hasOption("r")) { + System.err.println("--replicas is required"); + System.exit(-3); + } + int replicas = Integer.parseInt(cli.getOptionValue("r")); + scale(getClassForKind(kind)) + .apiClient(client) + .namespace(ns) + .name(name) + .replicas(replicas) + .execute(); + System.out.println("Deployment scaled."); + System.exit(0); + case "version": + System.out.println(version().apiClient(client)); + System.exit(0); + case "label": + kind = args[1]; + name = args[2]; + String labelKey = args[3]; + String labelValue = args[4]; + Class clazz = getClassForKind(kind); + if (clazz == null) { + System.err.println("Unknown kind: " + kind); + System.exit(-2); + } + label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); + System.exit(0); + case "exec": + name = args[1]; + String[] command = Arrays.copyOfRange(args, 2, args.length); + KubectlExec e = + exec() + .apiClient(client) + .namespace(ns) + .name(name) + .command(command) + .container(cli.getOptionValue("c", "")); + System.exit(e.execute()); + case "api-resources": + apiResources().apiClient(client).execute().stream() + .forEach( + r -> + System.out.printf( + "%s\t\t%s\t\t%s\t\t%s\n", + r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); + System.exit(0); + default: + System.out.println("Unknown verb: " + verb); + System.exit(-1); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java new file mode 100644 index 0000000000..0e48689602 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.time.Duration; +import java.util.UUID; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" + * + *

From inside $REPO_DIR/examples + */ +public class LeaderElectionExample { + public static void main(String[] args) throws Exception { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // New + String appNamespace = "default"; + String appName = "leader-election-foobar"; + String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique + EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); + + LeaderElectionConfig leaderElectionConfig = + new LeaderElectionConfig( + lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); + try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { + leaderElector.run( + () -> { + System.out.println("Do something when getting leadership."); + }, + () -> { + System.out.println("Do something when losing leadership."); + }); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java new file mode 100644 index 0000000000..dbfa157eea --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PodLogs; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.io.InputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" + * + *

From inside $REPO_DIR/examples + */ +public class LogsExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + CoreV1Api coreApi = new CoreV1Api(client); + + PodLogs logs = new PodLogs(); + V1Pod pod = + coreApi + .listNamespacedPod( + "default", "false", null, null, null, null, null, null, null, null, null) + .getItems() + .get(0); + + InputStream is = logs.streamNamespacedPodLog(pod); + Streams.copy(is, System.out); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java new file mode 100644 index 0000000000..0d8c10e30b --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Metrics; +import io.kubernetes.client.custom.ContainerMetrics; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.NodeMetricsList; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" + * + *

From inside $REPO_DIR/examples + */ +public class MetricsExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Metrics metrics = new Metrics(client); + NodeMetricsList list = metrics.getNodeMetrics(); + for (NodeMetrics item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + for (String key : item.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + item.getUsage().get(key)); + } + System.out.println(); + } + + for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + if (item.getContainers() == null) { + continue; + } + for (ContainerMetrics container : item.getContainers()) { + System.out.println(container.getName()); + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + for (String key : container.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + container.getUsage().get(key)); + } + System.out.println(); + } + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java new file mode 100644 index 0000000000..b0a4ac4fa4 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java @@ -0,0 +1,72 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.pager.Pager; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" + * + *

From inside $REPO_DIR/examples + */ +public class PagerExample { + public static void main(String[] args) throws IOException { + + ApiClient client = Config.defaultClient(); + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + CoreV1Api api = new CoreV1Api(); + int i = 0; + Pager pager = + new Pager( + (Pager.PagerParams param) -> { + try { + return api.listNamespaceCall( + null, + null, + param.getContinueToken(), + null, + null, + param.getLimit(), + null, + null, + 1, + null, + null); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, + client, + 10, + V1NamespaceList.class); + for (V1Namespace namespace : pager) { + System.out.println(namespace.getMetadata().getName()); + } + System.out.println("------------------"); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java new file mode 100644 index 0000000000..92866a46fe --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" + * + *

From inside $REPO_DIR/examples + */ +public class ParseExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + if (args.length < 2) { + System.err.println("Usage: ParseExample "); + System.exit(1); + } + ApiClient client = Config.defaultClient(); + FileReader json = new FileReader(args[0]); + Object obj = + client + .getJSON() + .getGson() + .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); + + String output = client.getJSON().getGson().toJson(obj); + + // Test round tripping... + Object obj2 = + client + .getJSON() + .getGson() + .fromJson( + new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); + + String output2 = client.getJSON().getGson().toJson(obj2); + + // Validate round trip + if (!output.equals(output2)) { + System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); + System.exit(2); + } + + System.out.println(output); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java new file mode 100644 index 0000000000..3f2457a47a --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java @@ -0,0 +1,129 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.PatchUtils; +import java.io.IOException; + +/** + * A simple Example of how to use the Java API.
+ * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
+ * For generating Json Patches, refer http://jsonpatch.com. For + * generating Strategic Merge Patches, refer strategic-merge-patch.md. + * + *

    + *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a + * finalizer. + *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. + *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. + *
+ * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" + * + *

From inside $REPO_DIR/examples + */ +public class PatchExample { + static String jsonPatchStr = + "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; + static String strategicMergePatchStr = + "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; + static String jsonDeploymentStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + static String applyYamlStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + + public static void main(String[] args) throws IOException { + try { + AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); + V1Deployment body = + Configuration.getDefaultApiClient() + .getJSON() + .deserialize(jsonDeploymentStr, V1Deployment.class); + + // create a deployment + V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null); + System.out.println("original deployment" + deploy1); + + // json-patch a deployment + V1Deployment deploy2 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(jsonPatchStr), + null, + null, + null, + null, // field-manager is optional + null, + null), + V1Patch.PATCH_FORMAT_JSON_PATCH, + api.getApiClient()); + System.out.println("json-patched deployment" + deploy2); + + // strategic-merge-patch a deployment + V1Deployment deploy3 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(strategicMergePatchStr), + null, + null, + null, + null, // field-manager is optional + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + api.getApiClient()); + System.out.println("strategic-merge-patched deployment" + deploy3); + + // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 + // or opt-in by turning on the feature gate for v1.14 or v1.15. + // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply + V1Deployment deploy4 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(applyYamlStr), + null, + null, + "example-field-manager", // field-manager is required for server-side apply + null, + true, + null), + V1Patch.PATCH_FORMAT_APPLY_YAML, + api.getApiClient()); + System.out.println("application/apply-patch+yaml deployment" + deploy4); + + } catch (ApiException e) { + System.out.println(e.getResponseBody()); + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java new file mode 100644 index 0000000000..cbe064db31 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PortForward; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.ArrayList; +import java.util.List; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside + * $REPO_DIR/examples + * + *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times + * out pretty fast...) + */ +public class PortForwardExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + PortForward forward = new PortForward(); + List ports = new ArrayList<>(); + int localPort = 8080; + int targetPort = 8080; + ports.add(targetPort); + final PortForward.PortForwardResult result = + forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); + System.out.println("Forwarding!"); + ServerSocket ss = new ServerSocket(localPort); + + final Socket s = ss.accept(); + System.out.println("Connected!"); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + + System.exit(0); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java new file mode 100644 index 0000000000..65f38b8ce4 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java @@ -0,0 +1,43 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.coreos.monitoring.models.V1Prometheus; +import com.coreos.monitoring.models.V1PrometheusList; +import com.coreos.monitoring.models.V1PrometheusSpec; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +public class PromOpExample { + public static void main(String[] args) throws IOException, ApiException { + GenericKubernetesApi prometheusApi = + new GenericKubernetesApi<>( + V1Prometheus.class, + V1PrometheusList.class, + "monitoring.coreos.com", + "v1", + "prometheuses", + ClientBuilder.defaultClient()); + prometheusApi + .create( + new V1Prometheus() + .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) + .kind("Prometheus") + .apiVersion("monitoring.coreos.com/v1") + .spec(new V1PrometheusSpec())) + .throwsApiException(); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java new file mode 100644 index 0000000000..d2afb10142 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java @@ -0,0 +1,66 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.monitoring.Monitoring; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API with Prometheus metrics + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" + * + *

From inside $REPO_DIR/examples + */ +public class PrometheusExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // Install an HTTP Interceptor that adds metrics + Monitoring.installMetrics(client); + + // Install a simple HTTP server to serve prometheus metrics. If you already are serving + // metrics elsewhere, this is unnecessary. + Monitoring.startMetricsServer("localhost", 8080); + + CoreV1Api api = new CoreV1Api(); + + while (true) { + // A request that should return 200 + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + // A request that should return 404 + try { + V1Pod pod = api.readNamespacedPod("foo", "bar", null); + } catch (ApiException ex) { + if (ex.getCode() != 404) { + throw ex; + } + } + try { + Thread.sleep(10000); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java new file mode 100644 index 0000000000..e4e05a2aa1 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java @@ -0,0 +1,69 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.ProtoClient; +import io.kubernetes.client.ProtoClient.ObjectOrStatus; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.proto.Meta.ObjectMeta; +import io.kubernetes.client.proto.V1.Namespace; +import io.kubernetes.client.proto.V1.NamespaceSpec; +import io.kubernetes.client.proto.V1.Pod; +import io.kubernetes.client.proto.V1.PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" + * + *

From inside $REPO_DIR/examples + */ +public class ProtoExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + ProtoClient pc = new ProtoClient(client); + ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); + + if (list.object.getItemsCount() > 0) { + Pod p = list.object.getItems(0); + System.out.println(p); + } + + Namespace namespace = + Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); + + ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); + System.out.println(ns); + if (ns.object != null) { + namespace = + ns.object + .toBuilder() + .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) + .build(); + // This is how you would update an object, but you can't actually + // update namespaces, so this returns a 405 + ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); + System.out.println(ns.status); + } + + ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); + System.out.println(ns); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java new file mode 100644 index 0000000000..f6494a836e --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.openapi.models.V1EndpointsList; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.time.Duration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + +@SpringBootApplication +public class SpringControllerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringControllerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner commandLineRunner( + SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("running controller.."); + nodePrintingController.run(); + }; + } + + @Bean + public Controller nodePrintingController( + SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { + DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); + builder = + builder.watch( + (q) -> { + return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) + .withResyncPeriod(Duration.ofMinutes(1)) + .build(); + }); + builder.withWorkerCount(2); + builder.withReadyFunc(reconciler::informerReady); + return builder.withReconciler(reconciler).withName("nodePrintingController").build(); + } + + @Bean + public SharedIndexInformer endpointsInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>( + V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); + } + + @Bean + public SharedIndexInformer nodeInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); + } + + @Bean + public SharedIndexInformer podInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); + } + } + + @Component + public static class NodePrintingReconciler implements Reconciler { + + @Value("${namespace}") + private String namespace; + + private SharedInformer nodeInformer; + + private SharedInformer podInformer; + + private Lister nodeLister; + + private Lister podLister; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { + this.nodeInformer = nodeInformer; + this.podInformer = podInformer; + this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); + this.podLister = new Lister<>(podInformer.getIndexer(), namespace); + } + + // *OPTIONAL* + // If you want to hold the controller from running util some condition.. + public boolean informerReady() { + return podInformer.hasSynced() && nodeInformer.hasSynced(); + } + + @Override + public Result reconcile(Request request) { + V1Node node = nodeLister.get(request.getName()); + + System.out.println("get all pods in namespace " + namespace); + podLister.namespace(namespace).list().stream() + .map(pod -> pod.getMetadata().getName()) + .forEach(System.out::println); + + System.out.println("triggered reconciling " + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java new file mode 100644 index 0000000000..bafe11e421 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.network.EndpointsLoadBalancer; +import io.kubernetes.client.extended.network.LoadBalancer; +import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class SpringLoadBalancerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringLoadBalancerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner loadBalancerCommandLineRunner( + SharedInformerFactory sharedInformerFactory, MyService myService) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("routing default/kubernetes:"); + System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); + }; + } + + @Bean + public MyService myService(SharedIndexInformer lister) { + return new MyService(new Lister<>(lister.getIndexer())); + } + } + + public static class MyService { + + private LoadBalancer defaultKubernetesLoadBalancer; + + public MyService(Lister lister) { + InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); + RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); + defaultKubernetesLoadBalancer = + new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java new file mode 100644 index 0000000000..c32a74afd4 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java @@ -0,0 +1,54 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.google.gson.reflect.TypeToken; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Watch; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** A simple example of how to use Watch API to watch changes in Namespace list. */ +public class WatchExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + // infinite timeout + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + Watch watch = + Watch.createWatch( + client, + api.listNamespaceCall( + null, null, null, null, null, 5, null, null, null, Boolean.TRUE, null), + new TypeToken>() {}.getType()); + + try { + for (Watch.Response item : watch) { + System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); + } + } finally { + watch.close(); + } + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java new file mode 100644 index 0000000000..e1f54dcd07 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java @@ -0,0 +1,74 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.WebSockets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import okhttp3.WebSocket; + +/** + * This is a pretty low level, most people won't need to use WebSockets directly. + * + *

If you do need to run it, you can run: mvn exec:java \ + * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ + * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true + * + *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP + * GET calls. + */ +public class WebSocketsExample { + public static void main(String... args) throws ApiException, IOException { + final ApiClient client = Config.defaultClient(); + WebSockets.stream( + args[0], + "GET", + client, + new WebSockets.SocketListener() { + private volatile WebSocket socket; + + @Override + public void open(String protocol, WebSocket socket) { + this.socket = socket; + } + + @Override + public void close() {} + + @Override + public void bytesMessage(InputStream is) {} + + @Override + public void failure(Throwable t) { + t.printStackTrace(); + } + + @Override + public void textMessage(Reader in) { + try { + BufferedReader reader = new BufferedReader(in); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + System.out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + } +} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java new file mode 100644 index 0000000000..67b5536ab9 --- /dev/null +++ b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java @@ -0,0 +1,109 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.IntOrString; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.openapi.models.V1ServiceBuilder; +import io.kubernetes.client.openapi.models.V1Status; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Yaml; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" + * + *

From inside $REPO_DIR/examples + */ +public class YamlExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .withNewResources() + .withLimits(new HashMap<>()) + .endResources() + .endContainer() + .endSpec() + .build(); + System.out.println(Yaml.dump(pod)); + + V1Service svc = + new V1ServiceBuilder() + .withNewMetadata() + .withName("aservice") + .endMetadata() + .withNewSpec() + .withSessionAffinity("ClientIP") + .withType("NodePort") + .addNewPort() + .withProtocol("TCP") + .withName("client") + .withPort(8008) + .withNodePort(8080) + .withTargetPort(new IntOrString(8080)) + .endPort() + .endSpec() + .build(); + System.out.println(Yaml.dump(svc)); + + // Read yaml configuration file, and deploy it + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // See issue #474. Not needed at most cases, but it is needed if you are using war + // packging or running this on JUnit. + Yaml.addModelMap("v1", "Service", V1Service.class); + + // Example yaml file can be found in $REPO_DIR/test-svc.yaml + File file = new File("test-svc.yaml"); + V1Service yamlSvc = (V1Service) Yaml.load(file); + + // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of + // CoreV1API + CoreV1Api api = new CoreV1Api(); + V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null); + + System.out.println(createResult); + + V1Service deleteResult = + api.deleteNamespacedService( + yamlSvc.getMetadata().getName(), + "default", + null, + null, + null, + null, + null, + new V1DeleteOptions()); + System.out.println(deleteResult); + } +} diff --git a/examples/examples-release-17/src/main/resources/application.properties b/examples/examples-release-17/src/main/resources/application.properties new file mode 100644 index 0000000000..dc886e5f48 --- /dev/null +++ b/examples/examples-release-17/src/main/resources/application.properties @@ -0,0 +1,2 @@ +namespace=airflow +management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java new file mode 100644 index 0000000000..df2f168e41 --- /dev/null +++ b/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.junit.Assert.assertEquals; + +import com.github.tomakehurst.wiremock.junit.WireMockRule; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; + +public class ExampleTest { + private static final int PORT = 8089; + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); + + @Test + public void exactUrlOnly() throws IOException, ApiException { + ApiClient client = new ApiClient(); + client.setBasePath("http://localhost:" + PORT); + Configuration.setDefaultApiClient(client); + + V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); + + stubFor( + get(urlEqualTo("/api/v1/namespaces/name")) + .willReturn( + aResponse() + .withHeader("Content-Type", "application/json") + .withBody(client.getJSON().serialize(ns1)))); + + CoreV1Api api = new CoreV1Api(); + V1Namespace ns2 = api.readNamespace("name", null); + assertEquals(ns1, ns2); + } +} diff --git a/examples/examples-release-17/test-svc.yaml b/examples/examples-release-17/test-svc.yaml new file mode 100644 index 0000000000..f225bea76f --- /dev/null +++ b/examples/examples-release-17/test-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: test-service +spec: + type: ClusterIP + selector: + app: test-service + ports: + - name: port-of-container + port: 8080 \ No newline at end of file diff --git a/examples/examples-release-17/test.yaml b/examples/examples-release-17/test.yaml new file mode 100644 index 0000000000..0b46e57003 --- /dev/null +++ b/examples/examples-release-17/test.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: test +spec: + replicas: 1 + template: + metadata: + labels: + app: test + spec: + containers: + - name: test + image: test/examples:1.0 + command: ["/bin/sh","-c"] + args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-18/Dockerfile b/examples/examples-release-18/Dockerfile new file mode 100644 index 0000000000..ac90eb1d67 --- /dev/null +++ b/examples/examples-release-18/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-jre + +COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar + +CMD ["java", "-jar", "/examples.jar"] + + diff --git a/examples/examples-release-18/README.md b/examples/examples-release-18/README.md new file mode 100644 index 0000000000..80c34ea272 --- /dev/null +++ b/examples/examples-release-18/README.md @@ -0,0 +1,13 @@ +# Running examples + +```sh +export REPO_ROOT=/path/to/client-java/repo + +cd ${REPO_ROOT}/ +mvn install + +cd ${REPO_ROOT}/examples/examples-15 +mvn compile +mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" +``` + diff --git a/examples/examples-release-18/createPod.sh b/examples/examples-release-18/createPod.sh new file mode 100755 index 0000000000..18a9841317 --- /dev/null +++ b/examples/examples-release-18/createPod.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# creates a pod and runs +# Example.java(list pods for all namespaces) on starting of pod + +# Exit on any error. +set -e + +if ! which minikube > /dev/null; then + echo "This script requires minikube installed." + exit 100 +fi + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +export REPO_ROOT=${dir}/.. + +cd ${REPO_ROOT} +mvn install + +cd ${REPO_ROOT}/examples +mvn package + +eval $(minikube docker-env) +docker build -t test/examples:1.0 . +kubectl apply -f test.yaml diff --git a/examples/examples-release-18/pom.xml b/examples/examples-release-18/pom.xml new file mode 100644 index 0000000000..a05742a6eb --- /dev/null +++ b/examples/examples-release-18/pom.xml @@ -0,0 +1,118 @@ + + 4.0.0 + + + io.kubernetes + client-java-examples-parent + 25.0.0-legacy-SNAPSHOT + .. + + + client-java-examples-release-18 + client-java-examples-release-18 + + + + ch.qos.logback + logback-classic + runtime + + + io.prometheus + simpleclient + 0.16.0 + + + io.prometheus + simpleclient_httpserver + 0.16.0 + + + io.kubernetes + client-java-api + 18.0.1 + + + io.kubernetes + client-java + 18.0.1 + + + io.kubernetes + client-java-extended + 18.0.1 + + + io.kubernetes + client-java-spring-integration + 18.0.1 + + + io.kubernetes + client-java-proto + 18.0.1 + + + commons-cli + commons-cli + + + io.kubernetes + client-java-cert-manager-models + 10.0.1 + + + io.kubernetes + client-java-prometheus-operator-models + 10.0.1 + + + + junit + junit + test + + + com.github.tomakehurst + wiremock + test + + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-actuator + ${spring.boot.version} + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + true + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + true + + + + + + \ No newline at end of file diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java new file mode 100644 index 0000000000..7f753b8d8f --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Attach; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" + * + *

From inside $REPO_DIR/examples + */ +public class AttachExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Attach attach = new Attach(); + final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); + + new Thread( + new Runnable() { + public void run() { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + OutputStream output = result.getStandardInputStream(); + try { + while (true) { + String line = in.readLine(); + output.write(line.getBytes()); + output.write('\n'); + output.flush(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getStandardOutputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + result.close(); + System.exit(0); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java new file mode 100644 index 0000000000..b616a18ee9 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; +import io.cert.manager.models.V1beta1Issuer; +import io.cert.manager.models.V1beta1IssuerList; +import io.cert.manager.models.V1beta1IssuerSpec; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +/** + * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a + * Kubernetes cluster where cert-manager is installed + */ +public class CertManagerExample { + public static void main(String[] args) throws IOException { + GenericKubernetesApi issuerApi = + new GenericKubernetesApi<>( + V1beta1Issuer.class, + V1beta1IssuerList.class, + "cert-manager.io", + "v1beta1", + "issuers", + ClientBuilder.defaultClient()); + issuerApi.create( + new V1beta1Issuer() + .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) + .kind("Issuer") + .apiVersion("cert-manager.io/v1beta1") + .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java new file mode 100644 index 0000000000..4fe2969a3d --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java @@ -0,0 +1,163 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.ControllerManager; +import io.kubernetes.client.extended.controller.LeaderElectingController; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.extended.event.EventType; +import io.kubernetes.client.extended.event.legacy.EventBroadcaster; +import io.kubernetes.client.extended.event.legacy.EventRecorder; +import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1EventSource; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.util.CallGeneratorParams; +import java.io.IOException; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +public class ControllerExample { + public static void main(String[] args) throws IOException { + + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + // instantiating an informer-factory, and there should be only one informer-factory + // globally. + SharedInformerFactory informerFactory = new SharedInformerFactory(); + // registering node-informer into the informer-factory. + SharedIndexInformer nodeInformer = + informerFactory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + informerFactory.startAllRegisteredInformers(); + + EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); + + // nodeReconciler prints node information on events + NodePrintingReconciler nodeReconciler = + new NodePrintingReconciler( + nodeInformer, + eventBroadcaster.newRecorder( + new V1EventSource().host("localhost").component("node-printer"))); + + // Use builder library to construct a default controller. + Controller controller = + ControllerBuilder.defaultBuilder(informerFactory) + .watch( + (workQueue) -> + ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) + .withWorkQueueKeyFunc( + (V1Node node) -> + new Request(node.getMetadata().getName())) // optional, default to + .withOnAddFilter( + (V1Node createdNode) -> + createdNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onAdd filter + .withOnUpdateFilter( + (V1Node oldNode, V1Node newNode) -> + newNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onUpdate filter + .withOnDeleteFilter( + (V1Node deletedNode, Boolean stateUnknown) -> + deletedNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onDelete filter + .build()) + .withReconciler(nodeReconciler) // required, set the actual reconciler + .withName("node-printing-controller") // optional, set name for controller + .withWorkerCount(4) // optional, set worker thread count + .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the + // cache has synced up + .build(); + + // Use builder library to manage one or multiple controllers. + ControllerManager controllerManager = + ControllerBuilder.controllerManagerBuilder(informerFactory) + .addController(controller) + .build(); + + LeaderElectingController leaderElectingController = + new LeaderElectingController( + new LeaderElector( + new LeaderElectionConfig( + new EndpointsLock("kube-system", "leader-election", "foo"), + Duration.ofMillis(10000), + Duration.ofMillis(8000), + Duration.ofMillis(5000))), + controllerManager); + + leaderElectingController.run(); + } + + static class NodePrintingReconciler implements Reconciler { + + private Lister nodeLister; + private EventRecorder eventRecorder; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, EventRecorder recorder) { + this.nodeLister = new Lister<>(nodeInformer.getIndexer()); + this.eventRecorder = recorder; + } + + @Override + public Result reconcile(Request request) { + V1Node node = this.nodeLister.get(request.getName()); + System.out.println("triggered reconciling " + node.getMetadata().getName()); + this.eventRecorder.event( + node, + EventType.Normal, + "Print Node", + "Successfully printed %s", + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java new file mode 100644 index 0000000000..bbb6575676 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Copy; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import io.kubernetes.client.util.exception.CopyNotSupportedException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" + * + *

From inside $REPO_DIR/examples + */ +public class CopyExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, CopyNotSupportedException { + String podName = "kube-addon-manager-minikube"; + String namespace = "kube-system"; + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Copy copy = new Copy(); + InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); + Streams.copy(dataStream, System.out); + + copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); + + System.out.println("Done!"); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java new file mode 100644 index 0000000000..42a2524f7b --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java @@ -0,0 +1,140 @@ +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentBuilder; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1LabelSelector; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.openapi.models.V1PodTemplateSpec; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.PatchUtils; +import io.kubernetes.client.util.wait.Wait; +import java.io.IOException; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.Collections; + +public class DeployRolloutRestartExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + AppsV1Api appsV1Api = new AppsV1Api(client); + + String deploymentName = "example-nginx"; + String imageName = "nginx:1.21.6"; + String namespace = "default"; + + // Create an example deployment + V1DeploymentBuilder deploymentBuilder = + new V1DeploymentBuilder() + .withApiVersion("apps/v1") + .withKind("Deployment") + .withMetadata(new V1ObjectMeta().name(deploymentName).namespace(namespace)) + .withSpec( + new V1DeploymentSpec() + .replicas(1) + .selector(new V1LabelSelector().putMatchLabelsItem("name", deploymentName)) + .template( + new V1PodTemplateSpec() + .metadata(new V1ObjectMeta().putLabelsItem("name", deploymentName)) + .spec( + new V1PodSpec() + .containers( + Collections.singletonList( + new V1Container() + .name(deploymentName) + .image(imageName)))))); + appsV1Api.createNamespacedDeployment( + namespace, deploymentBuilder.build(), null, null, null, null); + + // Wait until example deployment is ready + Wait.poll( + Duration.ofSeconds(3), + Duration.ofSeconds(60), + () -> { + try { + System.out.println("Waiting until example deployment is ready..."); + return appsV1Api + .readNamespacedDeployment(deploymentName, namespace, null) + .getStatus() + .getReadyReplicas() + > 0; + } catch (ApiException e) { + e.printStackTrace(); + return false; + } + }); + System.out.println("Created example deployment!"); + + // Trigger a rollout restart of the example deployment + V1Deployment runningDeployment = + appsV1Api.readNamespacedDeployment(deploymentName, namespace, null); + + // Explicitly set "restartedAt" annotation with current date/time to trigger rollout when patch + // is applied + runningDeployment + .getSpec() + .getTemplate() + .getMetadata() + .putAnnotationsItem("kubectl.kubernetes.io/restartedAt", LocalDateTime.now().toString()); + try { + String deploymentJson = client.getJSON().serialize(runningDeployment); + + PatchUtils.patch( + V1Deployment.class, + () -> + appsV1Api.patchNamespacedDeploymentCall( + deploymentName, + namespace, + new V1Patch(deploymentJson), + null, + null, + "kubectl-rollout", + null, + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + client); + + // Wait until deployment has stabilized after rollout restart + Wait.poll( + Duration.ofSeconds(3), + Duration.ofSeconds(60), + () -> { + try { + System.out.println("Waiting until example deployment restarted successfully..."); + return appsV1Api + .readNamespacedDeployment(deploymentName, namespace, null) + .getStatus() + .getReadyReplicas() + > 0; + } catch (ApiException e) { + e.printStackTrace(); + return false; + } + }); + System.out.println("Example deployment restarted successfully!"); + } catch (ApiException e) { + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java new file mode 100644 index 0000000000..b8cb04616d --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; +import java.io.IOException; + +public class DynamicClientExample { + + public static void main(String[] args) throws IOException, ApiException { + + ApiClient apiClient = ClientBuilder.standard().build(); + + // retrieving the latest state of the default namespace + DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); + DynamicKubernetesObject defaultNamespace = + dynamicApi.get("default").throwsApiException().getObject(); + + // attaching a "foo=bar" label to the default namespace + defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); + DynamicKubernetesObject updatedDefaultNamespace = + dynamicApi.update(defaultNamespace).throwsApiException().getObject(); + + System.out.println(updatedDefaultNamespace); + + apiClient.getHttpClient().connectionPool().evictAll(); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java new file mode 100644 index 0000000000..2c2d1d737e --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.Example" + * + *

From inside $REPO_DIR/examples + */ +public class Example { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java new file mode 100644 index 0000000000..acea8e815a --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Exec; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExecExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, ParseException { + final Options options = new Options(); + options.addOption(new Option("p", "pod", true, "The name of the pod")); + options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); + + CommandLineParser parser = new DefaultParser(); + CommandLine cmd = parser.parse(options, args); + + String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); + String namespace = cmd.getOptionValue("n", "default"); + args = cmd.getArgs(); + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Exec exec = new Exec(); + boolean tty = System.console() != null; + // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] + // {"sh", "-c", "echo foo"}, true, tty); + final Process proc = + exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); + + Thread in = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(System.in, proc.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + in.start(); + + Thread out = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(proc.getInputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + out.start(); + + proc.waitFor(); + + // wait for any last output; no need to wait for input thread + out.join(); + + proc.destroy(); + + System.exit(proc.exitValue()); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java new file mode 100644 index 0000000000..ab6ff1c448 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java @@ -0,0 +1,274 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentList; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1ServiceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExpandedExample { + + private static CoreV1Api COREV1_API; + private static final String DEFAULT_NAME_SPACE = "default"; + private static final Integer TIME_OUT_VALUE = 180; + private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); + + /** + * Main method + * + * @param args + */ + public static void main(String[] args) { + try { + ApiClient client = Config.defaultClient(); + // To change the context of k8s cluster, you can use + // io.kubernetes.client.util.KubeConfig + Configuration.setDefaultApiClient(client); + COREV1_API = new CoreV1Api(client); + + // ScaleUp/ScaleDown the Deployment pod + // Please change the name of Deployment? + System.out.println("----- Scale Deployment Start -----"); + scaleDeployment("account-service", 5); + + // List all of the namaspaces and pods + List nameSpaces = getAllNameSpaces(); + nameSpaces.stream() + .forEach( + namespace -> { + try { + System.out.println("----- " + namespace + " -----"); + getNamespacedPod(namespace).stream().forEach(System.out::println); + } catch (ApiException ex) { + LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); + } + }); + + // Print all of the Services + System.out.println("----- Print list all Services Start -----"); + List services = getServices(); + services.stream().forEach(System.out::println); + System.out.println("----- Print list all Services End -----"); + + // Print log of specific pod. In this example show the first pod logs. + System.out.println("----- Print Log of Specific Pod Start -----"); + String firstPodName = getPods().get(0); + printLog(DEFAULT_NAME_SPACE, firstPodName); + System.out.println("----- Print Log of Specific Pod End -----"); + } catch (ApiException | IOException ex) { + LOGGER.warn("Exception had occured ", ex); + } + } + + /** + * Get all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getAllNameSpaces() throws ApiException { + V1NamespaceList listNamespace = + COREV1_API.listNamespace( + null, null, null, null, null, null, null, null, null, null); + List list = + listNamespace.getItems().stream() + .map(v1Namespace -> v1Namespace.getMetadata().getName()) + .collect(Collectors.toList()); + return list; + } + + /** + * List all pod names in all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getPods() throws ApiException { + V1PodList v1podList = + COREV1_API.listPodForAllNamespaces( + null, null, null, null, null, null, null, null, null, null); + List podList = + v1podList.getItems().stream() + .map(v1Pod -> v1Pod.getMetadata().getName()) + .collect(Collectors.toList()); + return podList; + } + + /** + * List all pod in the default namespace + * + * @return + * @throws ApiException + */ + public static List getNamespacedPod() throws ApiException { + return getNamespacedPod(DEFAULT_NAME_SPACE, null); + } + + /** + * List pod in specific namespace + * + * @param namespace + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace) throws ApiException { + return getNamespacedPod(namespace, null); + } + + /** + * List pod in specific namespace with label + * + * @param namespace + * @param label + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace, String label) throws ApiException { + V1PodList listNamespacedPod = + COREV1_API.listNamespacedPod( + namespace, + null, + null, + null, + null, + label, + null, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + List listPods = + listNamespacedPod.getItems().stream() + .map(v1pod -> v1pod.getMetadata().getName()) + .collect(Collectors.toList()); + return listPods; + } + + /** + * List all Services in default namespace + * + * @return + * @throws ApiException + */ + public static List getServices() throws ApiException { + V1ServiceList listNamespacedService = + COREV1_API.listNamespacedService( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + return listNamespacedService.getItems().stream() + .map(v1service -> v1service.getMetadata().getName()) + .collect(Collectors.toList()); + } + + /** + * Scale up/down the number of pod in Deployment + * + * @param deploymentName + * @param numberOfReplicas + * @throws ApiException + */ + public static void scaleDeployment(String deploymentName, int numberOfReplicas) + throws ApiException { + AppsV1Api appsV1Api = new AppsV1Api(); + appsV1Api.setApiClient(COREV1_API.getApiClient()); + V1DeploymentList listNamespacedDeployment = + appsV1Api.listNamespacedDeployment( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + null, + Boolean.FALSE); + + List appsV1DeploymentItems = listNamespacedDeployment.getItems(); + Optional findedDeployment = + appsV1DeploymentItems.stream() + .filter( + (V1Deployment deployment) -> + deployment.getMetadata().getName().equals(deploymentName)) + .findFirst(); + findedDeployment.ifPresent( + (V1Deployment deploy) -> { + try { + V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); + V1Deployment newDeploy = deploy.spec(newSpec); + appsV1Api.replaceNamespacedDeployment( + deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); + } catch (ApiException ex) { + LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); + } + }); + } + + /** + * Print out the Log for specific Pods + * + * @param namespace + * @param podName + * @throws ApiException + */ + public static void printLog(String namespace, String podName) throws ApiException { + // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog + String readNamespacedPodLog = + COREV1_API.readNamespacedPodLog( + podName, + namespace, + null, + Boolean.FALSE, + null, + Integer.MAX_VALUE, + null, + Boolean.FALSE, + Integer.MAX_VALUE, + 40, + Boolean.FALSE); + System.out.println(readNamespacedPodLog); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java new file mode 100644 index 0000000000..8e48cc51b3 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.Arrays; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" + * + *

From inside $REPO_DIR/examples + */ +public class FluentExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .endContainer() + .endSpec() + .build(); + + api.createNamespacedPod("default", pod, null, null, null, null); + + V1Pod pod2 = + new V1Pod() + .metadata(new V1ObjectMeta().name("anotherpod")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); + + api.createNamespacedPod("default", pod2, null, null, null, null); + + V1PodList list = + api.listNamespacedPod( + "default", null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java new file mode 100644 index 0000000000..ddfb1243b8 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java @@ -0,0 +1,63 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.util.Arrays; + +public class GenericClientExample { + + public static void main(String[] args) throws Exception { + + // The following codes demonstrates using generic client to manipulate pods + V1Pod pod = + new V1Pod() + .metadata(new V1ObjectMeta().name("foo").namespace("default")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("c").image("test")))); + + ApiClient apiClient = ClientBuilder.standard().build(); + GenericKubernetesApi podClient = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + + V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); + System.out.println("Created!"); + + V1Pod patchedPod = + podClient + .patch( + "default", + "foo", + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) + .throwsApiException() + .getObject(); + System.out.println("Patched!"); + + V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); + if (deletedPod != null) { + System.out.println( + "Received after-deletion status of the requested object, will be deleting in background!"); + } + System.out.println("Deleted!"); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java new file mode 100644 index 0000000000..7ab705b440 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import java.io.IOException; + +/** + * A simple example of how to use the Java API inside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class InClusterClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // loading the in-cluster config, including: + // 1. service-account CA + // 2. service-account bearer-token + // 3. service-account namespace + // 4. master endpoints(ip, port) from pre-set environment variables + ApiClient client = ClientBuilder.cluster().build(); + + // if you prefer not to refresh service account token, please use: + // ApiClient client = ClientBuilder.oldCluster().build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java new file mode 100644 index 0000000000..e8bef1ce71 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java @@ -0,0 +1,106 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.informer.ResourceEventHandler; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.CallGeneratorParams; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" + * + *

From inside $REPO_DIR/examples + */ +public class InformerExample { + public static void main(String[] args) throws Exception { + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + SharedInformerFactory factory = new SharedInformerFactory(apiClient); + + // Node informer + SharedIndexInformer nodeInformer = + factory.sharedIndexInformerFor( + // **NOTE**: + // The following "CallGeneratorParams" lambda merely generates a stateless + // HTTPs requests, the effective apiClient is the one specified when constructing + // the informer-factory. + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + + nodeInformer.addEventHandler( + new ResourceEventHandler() { + @Override + public void onAdd(V1Node node) { + System.out.printf("%s node added!\n", node.getMetadata().getName()); + } + + @Override + public void onUpdate(V1Node oldNode, V1Node newNode) { + System.out.printf( + "%s => %s node updated!\n", + oldNode.getMetadata().getName(), newNode.getMetadata().getName()); + } + + @Override + public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { + System.out.printf("%s node deleted!\n", node.getMetadata().getName()); + } + }); + + factory.startAllRegisteredInformers(); + + V1Node nodeToCreate = new V1Node(); + V1ObjectMeta metadata = new V1ObjectMeta(); + metadata.setName("noxu"); + nodeToCreate.setMetadata(metadata); + V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); + Thread.sleep(3000); + + Lister nodeLister = new Lister(nodeInformer.getIndexer()); + V1Node node = nodeLister.get("noxu"); + System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); + factory.stopAllRegisteredInformers(); + Thread.sleep(3000); + System.out.println("informer stopped.."); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java new file mode 100644 index 0000000000..c4b15401b0 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.KubeConfig; +import java.io.FileReader; +import java.io.IOException; + +/** + * A simple example of how to use the Java API from an application outside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class KubeConfigFileClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // file path to your KubeConfig + + String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; + + // loading the out-of-cluster config, a kubeconfig from file-system + ApiClient client = + ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java new file mode 100644 index 0000000000..2619c9f271 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java @@ -0,0 +1,311 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; +import static io.kubernetes.client.extended.kubectl.Kubectl.copy; +import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.delete; +import static io.kubernetes.client.extended.kubectl.Kubectl.drain; +import static io.kubernetes.client.extended.kubectl.Kubectl.exec; +import static io.kubernetes.client.extended.kubectl.Kubectl.label; +import static io.kubernetes.client.extended.kubectl.Kubectl.log; +import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; +import static io.kubernetes.client.extended.kubectl.Kubectl.scale; +import static io.kubernetes.client.extended.kubectl.Kubectl.taint; +import static io.kubernetes.client.extended.kubectl.Kubectl.top; +import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.version; +import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; + +import io.kubernetes.client.common.KubernetesObject; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.extended.kubectl.KubectlExec; +import io.kubernetes.client.extended.kubectl.KubectlPortForward; +import io.kubernetes.client.extended.kubectl.exception.KubectlException; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1ReplicationController; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.tuple.Pair; + +/** + * A Java equivalent for the kubectl command line tool. Not nearly as complete. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" + * + *

From inside $REPO_DIR/examples + */ +public class KubectlExample { + static Class getClassForKind(String kind) { + switch (kind) { + case "pod": + case "pods": + return V1Pod.class; + case "deployment": + case "deployments": + return V1Deployment.class; + case "service": + case "services": + return V1Service.class; + case "node": + case "nodes": + return V1Node.class; + case "replicationcontroller": + case "replicationcontrollers": + return V1ReplicationController.class; + } + return null; + } + + private static final String PADDING = " "; + + private static String pad(String value) { + while (value.length() < PADDING.length()) { + value += " "; + } + return value; + } + + public static void main(String[] args) + throws java.io.IOException, KubectlException, ParseException { + ApiClient client = Config.defaultClient(); + + Options options = new Options(); + options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); + options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); + options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); + DefaultParser parser = new DefaultParser(); + CommandLine cli = parser.parse(options, args); + + args = cli.getArgs(); + String verb = args[0]; + String ns = cli.getOptionValue("n", "default"); + String kind = null; + String name = null; + + switch (verb) { + case "delete": + kind = args[1]; + name = args[2]; + delete(getClassForKind(kind)).namespace(ns).name(name).execute(); + case "drain": + name = args[1]; + drain().apiClient(client).name(name).execute(); + System.out.println("Node drained"); + System.exit(0); + case "cordon": + name = args[1]; + cordon().apiClient(client).name(name).execute(); + System.out.println("Node cordoned"); + System.exit(0); + case "uncordon": + name = args[1]; + uncordon().apiClient(client).name(name).execute(); + System.out.println("Node uncordoned"); + System.exit(0); + case "top": + String what = args[1]; + switch (what) { + case "nodes": + case "node": + List> nodes = + top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); + System.out.println(pad("Node") + "\tCPU\t\tMemory"); + for (Pair node : nodes) { + System.out.println( + pad(node.getLeft().getMetadata().getName()) + + "\t" + + node.getRight().getUsage().get("cpu").getNumber() + + "\t" + + node.getRight().getUsage().get("memory").getNumber()); + } + System.exit(0); + case "pods": + case "pod": + List> pods = + top(V1Pod.class, PodMetrics.class) + .apiClient(client) + .namespace(ns) + .metric("cpu") + .execute(); + System.out.println(pad("Pod") + "\tCPU\t\tMemory"); + for (Pair pod : pods) { + System.out.println( + pad(pod.getLeft().getMetadata().getName()) + + "\t" + + podMetricSum(pod.getRight(), "cpu") + + "\t" + + podMetricSum(pod.getRight(), "memory")); + } + System.exit(0); + } + System.err.println("Unknown top argument: " + what); + System.exit(-1); + case "cp": + String from = args[1]; + String to = args[2]; + if (from.indexOf(":") != -1) { + String[] parts = from.split(":"); + name = parts[0]; + from = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .fromPod(from) + .to(to) + .execute(); + } else if (to.indexOf(":") != -1) { + String[] parts = to.split(":"); + name = parts[0]; + to = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .from(from) + .toPod(to) + .execute(); + } else { + System.err.println("Missing pod name for copy."); + System.exit(-1); + } + System.out.println("Copied " + from + " -> " + to); + System.exit(0); + case "taint": + name = args[1]; + String taintSpec = args[2]; + boolean remove = taintSpec.endsWith("-"); + int ix = taintSpec.indexOf("="); + int ix2 = taintSpec.indexOf(":"); + + if (remove) { + taintSpec = taintSpec.substring(0, taintSpec.length() - 2); + String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); + String effect = ix == -1 ? null : taintSpec.substring(ix + 1); + + if (effect == null) { + taint().apiClient(client).name(name).removeTaint(key).execute(); + } else { + taint().apiClient(client).name(name).removeTaint(key, effect).execute(); + } + System.exit(0); + } + if (ix2 == -1) { + System.err.println("key:effect or key=value:effect is required."); + System.exit(-1); + } + String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); + String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); + String effect = taintSpec.substring(ix2 + 1); + + if (value == null) { + taint().apiClient(client).name(name).addTaint(key, effect).execute(); + } else { + taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); + } + System.exit(0); + case "portforward": + name = args[1]; + KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); + for (int i = 2; i < args.length; i++) { + String port = args[i]; + String[] ports = port.split(":"); + System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); + forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); + } + forward.execute(); + System.exit(0); + case "log": + name = args[1]; + Streams.copy( + log() + .apiClient(client) + .name(name) + .namespace(ns) + .container(cli.getOptionValue("c", "")) + .execute(), + System.out); + System.exit(0); + case "scale": + kind = args[1]; + name = args[2]; + if (!cli.hasOption("r")) { + System.err.println("--replicas is required"); + System.exit(-3); + } + int replicas = Integer.parseInt(cli.getOptionValue("r")); + scale(getClassForKind(kind)) + .apiClient(client) + .namespace(ns) + .name(name) + .replicas(replicas) + .execute(); + System.out.println("Deployment scaled."); + System.exit(0); + case "version": + System.out.println(version().apiClient(client)); + System.exit(0); + case "label": + kind = args[1]; + name = args[2]; + String labelKey = args[3]; + String labelValue = args[4]; + Class clazz = getClassForKind(kind); + if (clazz == null) { + System.err.println("Unknown kind: " + kind); + System.exit(-2); + } + label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); + System.exit(0); + case "exec": + name = args[1]; + String[] command = Arrays.copyOfRange(args, 2, args.length); + KubectlExec e = + exec() + .apiClient(client) + .namespace(ns) + .name(name) + .command(command) + .container(cli.getOptionValue("c", "")); + System.exit(e.execute()); + case "api-resources": + apiResources().apiClient(client).execute().stream() + .forEach( + r -> + System.out.printf( + "%s\t\t%s\t\t%s\t\t%s\n", + r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); + System.exit(0); + default: + System.out.println("Unknown verb: " + verb); + System.exit(-1); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java new file mode 100644 index 0000000000..0e48689602 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.time.Duration; +import java.util.UUID; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" + * + *

From inside $REPO_DIR/examples + */ +public class LeaderElectionExample { + public static void main(String[] args) throws Exception { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // New + String appNamespace = "default"; + String appName = "leader-election-foobar"; + String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique + EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); + + LeaderElectionConfig leaderElectionConfig = + new LeaderElectionConfig( + lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); + try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { + leaderElector.run( + () -> { + System.out.println("Do something when getting leadership."); + }, + () -> { + System.out.println("Do something when losing leadership."); + }); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java new file mode 100644 index 0000000000..e1df5964d3 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PodLogs; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.io.InputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" + * + *

From inside $REPO_DIR/examples + */ +public class LogsExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + CoreV1Api coreApi = new CoreV1Api(client); + + PodLogs logs = new PodLogs(); + V1Pod pod = + coreApi + .listNamespacedPod( + "default", "false", null, null, null, null, null, null, null, null, null) + .getItems() + .get(0); + + InputStream is = logs.streamNamespacedPodLog(pod); + Streams.copy(is, System.out); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java new file mode 100644 index 0000000000..0d8c10e30b --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Metrics; +import io.kubernetes.client.custom.ContainerMetrics; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.NodeMetricsList; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" + * + *

From inside $REPO_DIR/examples + */ +public class MetricsExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Metrics metrics = new Metrics(client); + NodeMetricsList list = metrics.getNodeMetrics(); + for (NodeMetrics item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + for (String key : item.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + item.getUsage().get(key)); + } + System.out.println(); + } + + for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + if (item.getContainers() == null) { + continue; + } + for (ContainerMetrics container : item.getContainers()) { + System.out.println(container.getName()); + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + for (String key : container.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + container.getUsage().get(key)); + } + System.out.println(); + } + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java new file mode 100644 index 0000000000..b0a4ac4fa4 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java @@ -0,0 +1,72 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.pager.Pager; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" + * + *

From inside $REPO_DIR/examples + */ +public class PagerExample { + public static void main(String[] args) throws IOException { + + ApiClient client = Config.defaultClient(); + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + CoreV1Api api = new CoreV1Api(); + int i = 0; + Pager pager = + new Pager( + (Pager.PagerParams param) -> { + try { + return api.listNamespaceCall( + null, + null, + param.getContinueToken(), + null, + null, + param.getLimit(), + null, + null, + 1, + null, + null); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, + client, + 10, + V1NamespaceList.class); + for (V1Namespace namespace : pager) { + System.out.println(namespace.getMetadata().getName()); + } + System.out.println("------------------"); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java new file mode 100644 index 0000000000..92866a46fe --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" + * + *

From inside $REPO_DIR/examples + */ +public class ParseExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + if (args.length < 2) { + System.err.println("Usage: ParseExample "); + System.exit(1); + } + ApiClient client = Config.defaultClient(); + FileReader json = new FileReader(args[0]); + Object obj = + client + .getJSON() + .getGson() + .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); + + String output = client.getJSON().getGson().toJson(obj); + + // Test round tripping... + Object obj2 = + client + .getJSON() + .getGson() + .fromJson( + new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); + + String output2 = client.getJSON().getGson().toJson(obj2); + + // Validate round trip + if (!output.equals(output2)) { + System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); + System.exit(2); + } + + System.out.println(output); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java new file mode 100644 index 0000000000..7eed3360d3 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.PatchUtils; +import java.io.IOException; + +/** + * A simple Example of how to use the Java API.
+ * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
+ * For generating Json Patches, refer http://jsonpatch.com. For + * generating Strategic Merge Patches, refer strategic-merge-patch.md. + * + *

    + *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a + * finalizer. + *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. + *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. + *
+ * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" + * + *

From inside $REPO_DIR/examples + */ +public class PatchExample { + static String jsonPatchStr = + "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; + static String strategicMergePatchStr = + "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; + static String jsonDeploymentStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + static String applyYamlStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + + public static void main(String[] args) throws IOException { + try { + AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); + V1Deployment body = + Configuration.getDefaultApiClient() + .getJSON() + .deserialize(jsonDeploymentStr, V1Deployment.class); + + // create a deployment + V1Deployment deploy1 = + api.createNamespacedDeployment("default", body, null, null, null, null); + System.out.println("original deployment" + deploy1); + + // json-patch a deployment + V1Deployment deploy2 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(jsonPatchStr), + null, + null, + null, + null, // field-manager is optional + null, + null), + V1Patch.PATCH_FORMAT_JSON_PATCH, + api.getApiClient()); + System.out.println("json-patched deployment" + deploy2); + + // strategic-merge-patch a deployment + V1Deployment deploy3 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(strategicMergePatchStr), + null, + null, + null, // field-manager is optional + null, + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + api.getApiClient()); + System.out.println("strategic-merge-patched deployment" + deploy3); + + // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 + // or opt-in by turning on the feature gate for v1.14 or v1.15. + // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply + V1Deployment deploy4 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(applyYamlStr), + null, + null, + "example-field-manager", // field-manager is required for server-side apply + null, + true, + null), + V1Patch.PATCH_FORMAT_APPLY_YAML, + api.getApiClient()); + System.out.println("application/apply-patch+yaml deployment" + deploy4); + + } catch (ApiException e) { + System.out.println(e.getResponseBody()); + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java new file mode 100644 index 0000000000..cbe064db31 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PortForward; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.ArrayList; +import java.util.List; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside + * $REPO_DIR/examples + * + *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times + * out pretty fast...) + */ +public class PortForwardExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + PortForward forward = new PortForward(); + List ports = new ArrayList<>(); + int localPort = 8080; + int targetPort = 8080; + ports.add(targetPort); + final PortForward.PortForwardResult result = + forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); + System.out.println("Forwarding!"); + ServerSocket ss = new ServerSocket(localPort); + + final Socket s = ss.accept(); + System.out.println("Connected!"); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + + System.exit(0); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java new file mode 100644 index 0000000000..65f38b8ce4 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java @@ -0,0 +1,43 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.coreos.monitoring.models.V1Prometheus; +import com.coreos.monitoring.models.V1PrometheusList; +import com.coreos.monitoring.models.V1PrometheusSpec; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +public class PromOpExample { + public static void main(String[] args) throws IOException, ApiException { + GenericKubernetesApi prometheusApi = + new GenericKubernetesApi<>( + V1Prometheus.class, + V1PrometheusList.class, + "monitoring.coreos.com", + "v1", + "prometheuses", + ClientBuilder.defaultClient()); + prometheusApi + .create( + new V1Prometheus() + .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) + .kind("Prometheus") + .apiVersion("monitoring.coreos.com/v1") + .spec(new V1PrometheusSpec())) + .throwsApiException(); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java new file mode 100644 index 0000000000..a365704030 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java @@ -0,0 +1,66 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.monitoring.Monitoring; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API with Prometheus metrics + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" + * + *

From inside $REPO_DIR/examples + */ +public class PrometheusExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // Install an HTTP Interceptor that adds metrics + Monitoring.installMetrics(client); + + // Install a simple HTTP server to serve prometheus metrics. If you already are serving + // metrics elsewhere, this is unnecessary. + Monitoring.startMetricsServer("localhost", 8080); + + CoreV1Api api = new CoreV1Api(); + + while (true) { + // A request that should return 200 + V1PodList list = + api.listPodForAllNamespaces( null, null, null, null, null, null, null, null, null, null); + // A request that should return 404 + try { + V1Pod pod = api.readNamespacedPod("foo", "bar", null); + } catch (ApiException ex) { + if (ex.getCode() != 404) { + throw ex; + } + } + try { + Thread.sleep(10000); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java new file mode 100644 index 0000000000..e4e05a2aa1 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java @@ -0,0 +1,69 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.ProtoClient; +import io.kubernetes.client.ProtoClient.ObjectOrStatus; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.proto.Meta.ObjectMeta; +import io.kubernetes.client.proto.V1.Namespace; +import io.kubernetes.client.proto.V1.NamespaceSpec; +import io.kubernetes.client.proto.V1.Pod; +import io.kubernetes.client.proto.V1.PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" + * + *

From inside $REPO_DIR/examples + */ +public class ProtoExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + ProtoClient pc = new ProtoClient(client); + ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); + + if (list.object.getItemsCount() > 0) { + Pod p = list.object.getItems(0); + System.out.println(p); + } + + Namespace namespace = + Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); + + ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); + System.out.println(ns); + if (ns.object != null) { + namespace = + ns.object + .toBuilder() + .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) + .build(); + // This is how you would update an object, but you can't actually + // update namespaces, so this returns a 405 + ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); + System.out.println(ns.status); + } + + ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); + System.out.println(ns); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java new file mode 100644 index 0000000000..f6494a836e --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.openapi.models.V1EndpointsList; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.time.Duration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + +@SpringBootApplication +public class SpringControllerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringControllerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner commandLineRunner( + SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("running controller.."); + nodePrintingController.run(); + }; + } + + @Bean + public Controller nodePrintingController( + SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { + DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); + builder = + builder.watch( + (q) -> { + return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) + .withResyncPeriod(Duration.ofMinutes(1)) + .build(); + }); + builder.withWorkerCount(2); + builder.withReadyFunc(reconciler::informerReady); + return builder.withReconciler(reconciler).withName("nodePrintingController").build(); + } + + @Bean + public SharedIndexInformer endpointsInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>( + V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); + } + + @Bean + public SharedIndexInformer nodeInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); + } + + @Bean + public SharedIndexInformer podInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); + } + } + + @Component + public static class NodePrintingReconciler implements Reconciler { + + @Value("${namespace}") + private String namespace; + + private SharedInformer nodeInformer; + + private SharedInformer podInformer; + + private Lister nodeLister; + + private Lister podLister; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { + this.nodeInformer = nodeInformer; + this.podInformer = podInformer; + this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); + this.podLister = new Lister<>(podInformer.getIndexer(), namespace); + } + + // *OPTIONAL* + // If you want to hold the controller from running util some condition.. + public boolean informerReady() { + return podInformer.hasSynced() && nodeInformer.hasSynced(); + } + + @Override + public Result reconcile(Request request) { + V1Node node = nodeLister.get(request.getName()); + + System.out.println("get all pods in namespace " + namespace); + podLister.namespace(namespace).list().stream() + .map(pod -> pod.getMetadata().getName()) + .forEach(System.out::println); + + System.out.println("triggered reconciling " + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java new file mode 100644 index 0000000000..bafe11e421 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.network.EndpointsLoadBalancer; +import io.kubernetes.client.extended.network.LoadBalancer; +import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class SpringLoadBalancerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringLoadBalancerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner loadBalancerCommandLineRunner( + SharedInformerFactory sharedInformerFactory, MyService myService) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("routing default/kubernetes:"); + System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); + }; + } + + @Bean + public MyService myService(SharedIndexInformer lister) { + return new MyService(new Lister<>(lister.getIndexer())); + } + } + + public static class MyService { + + private LoadBalancer defaultKubernetesLoadBalancer; + + public MyService(Lister lister) { + InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); + RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); + defaultKubernetesLoadBalancer = + new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java new file mode 100644 index 0000000000..23ecce52d5 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java @@ -0,0 +1,54 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.google.gson.reflect.TypeToken; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Watch; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** A simple example of how to use Watch API to watch changes in Namespace list. */ +public class WatchExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + // infinite timeout + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + Watch watch = + Watch.createWatch( + client, + api.listNamespaceCall( + null, null, null, null, null, null, null, null, null, Boolean.TRUE, null), + new TypeToken>() {}.getType()); + + try { + for (Watch.Response item : watch) { + System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); + } + } finally { + watch.close(); + } + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java new file mode 100644 index 0000000000..e1f54dcd07 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java @@ -0,0 +1,74 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.WebSockets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import okhttp3.WebSocket; + +/** + * This is a pretty low level, most people won't need to use WebSockets directly. + * + *

If you do need to run it, you can run: mvn exec:java \ + * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ + * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true + * + *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP + * GET calls. + */ +public class WebSocketsExample { + public static void main(String... args) throws ApiException, IOException { + final ApiClient client = Config.defaultClient(); + WebSockets.stream( + args[0], + "GET", + client, + new WebSockets.SocketListener() { + private volatile WebSocket socket; + + @Override + public void open(String protocol, WebSocket socket) { + this.socket = socket; + } + + @Override + public void close() {} + + @Override + public void bytesMessage(InputStream is) {} + + @Override + public void failure(Throwable t) { + t.printStackTrace(); + } + + @Override + public void textMessage(Reader in) { + try { + BufferedReader reader = new BufferedReader(in); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + System.out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + } +} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java new file mode 100644 index 0000000000..b3f0dc6626 --- /dev/null +++ b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java @@ -0,0 +1,109 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.IntOrString; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.openapi.models.V1ServiceBuilder; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Yaml; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" + * + *

From inside $REPO_DIR/examples + */ +public class YamlExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .withNewResources() + .withLimits(new HashMap<>()) + .endResources() + .endContainer() + .endSpec() + .build(); + System.out.println(Yaml.dump(pod)); + + V1Service svc = + new V1ServiceBuilder() + .withNewMetadata() + .withName("aservice") + .endMetadata() + .withNewSpec() + .withSessionAffinity("ClientIP") + .withType("NodePort") + .addNewPort() + .withProtocol("TCP") + .withName("client") + .withPort(8008) + .withNodePort(8080) + .withTargetPort(new IntOrString(8080)) + .endPort() + .endSpec() + .build(); + System.out.println(Yaml.dump(svc)); + + // Read yaml configuration file, and deploy it + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // See issue #474. Not needed at most cases, but it is needed if you are using war + // packging or running this on JUnit. + Yaml.addModelMap("v1", "Service", V1Service.class); + + // Example yaml file can be found in $REPO_DIR/test-svc.yaml + File file = new File("test-svc.yaml"); + V1Service yamlSvc = (V1Service) Yaml.load(file); + + // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of + // CoreV1API + CoreV1Api api = new CoreV1Api(); + V1Service createResult = + api.createNamespacedService("default", yamlSvc, null, null, null, null); + + System.out.println(createResult); + + V1Service deleteResult = + api.deleteNamespacedService( + yamlSvc.getMetadata().getName(), + "default", + null, + null, + null, + null, + null, + new V1DeleteOptions()); + System.out.println(deleteResult); + } +} diff --git a/examples/examples-release-18/src/main/resources/application.properties b/examples/examples-release-18/src/main/resources/application.properties new file mode 100644 index 0000000000..dc886e5f48 --- /dev/null +++ b/examples/examples-release-18/src/main/resources/application.properties @@ -0,0 +1,2 @@ +namespace=airflow +management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java new file mode 100644 index 0000000000..df2f168e41 --- /dev/null +++ b/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.junit.Assert.assertEquals; + +import com.github.tomakehurst.wiremock.junit.WireMockRule; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; + +public class ExampleTest { + private static final int PORT = 8089; + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); + + @Test + public void exactUrlOnly() throws IOException, ApiException { + ApiClient client = new ApiClient(); + client.setBasePath("http://localhost:" + PORT); + Configuration.setDefaultApiClient(client); + + V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); + + stubFor( + get(urlEqualTo("/api/v1/namespaces/name")) + .willReturn( + aResponse() + .withHeader("Content-Type", "application/json") + .withBody(client.getJSON().serialize(ns1)))); + + CoreV1Api api = new CoreV1Api(); + V1Namespace ns2 = api.readNamespace("name", null); + assertEquals(ns1, ns2); + } +} diff --git a/examples/examples-release-18/test-svc.yaml b/examples/examples-release-18/test-svc.yaml new file mode 100644 index 0000000000..f225bea76f --- /dev/null +++ b/examples/examples-release-18/test-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: test-service +spec: + type: ClusterIP + selector: + app: test-service + ports: + - name: port-of-container + port: 8080 \ No newline at end of file diff --git a/examples/examples-release-18/test.yaml b/examples/examples-release-18/test.yaml new file mode 100644 index 0000000000..0b46e57003 --- /dev/null +++ b/examples/examples-release-18/test.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: test +spec: + replicas: 1 + template: + metadata: + labels: + app: test + spec: + containers: + - name: test + image: test/examples:1.0 + command: ["/bin/sh","-c"] + args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-19/Dockerfile b/examples/examples-release-19/Dockerfile new file mode 100644 index 0000000000..ac90eb1d67 --- /dev/null +++ b/examples/examples-release-19/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-jre + +COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar + +CMD ["java", "-jar", "/examples.jar"] + + diff --git a/examples/examples-release-19/README.md b/examples/examples-release-19/README.md new file mode 100644 index 0000000000..80c34ea272 --- /dev/null +++ b/examples/examples-release-19/README.md @@ -0,0 +1,13 @@ +# Running examples + +```sh +export REPO_ROOT=/path/to/client-java/repo + +cd ${REPO_ROOT}/ +mvn install + +cd ${REPO_ROOT}/examples/examples-15 +mvn compile +mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" +``` + diff --git a/examples/examples-release-19/createPod.sh b/examples/examples-release-19/createPod.sh new file mode 100755 index 0000000000..18a9841317 --- /dev/null +++ b/examples/examples-release-19/createPod.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# creates a pod and runs +# Example.java(list pods for all namespaces) on starting of pod + +# Exit on any error. +set -e + +if ! which minikube > /dev/null; then + echo "This script requires minikube installed." + exit 100 +fi + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +export REPO_ROOT=${dir}/.. + +cd ${REPO_ROOT} +mvn install + +cd ${REPO_ROOT}/examples +mvn package + +eval $(minikube docker-env) +docker build -t test/examples:1.0 . +kubectl apply -f test.yaml diff --git a/examples/examples-release-19/pom.xml b/examples/examples-release-19/pom.xml new file mode 100644 index 0000000000..b6703d369e --- /dev/null +++ b/examples/examples-release-19/pom.xml @@ -0,0 +1,110 @@ + + 4.0.0 + + + io.kubernetes + client-java-examples-parent + 25.0.0-legacy-SNAPSHOT + .. + + + client-java-examples-release-19 + client-java-examples-release-19 + + + + ch.qos.logback + logback-classic + runtime + + + io.prometheus + simpleclient + 0.16.0 + + + io.prometheus + simpleclient_httpserver + 0.16.0 + + + io.kubernetes + client-java-api + ${project.version} + + + io.kubernetes + client-java + ${project.version} + + + io.kubernetes + client-java-extended + ${project.version} + + + io.kubernetes + client-java-spring-integration + ${project.version} + + + io.kubernetes + client-java-proto + ${project.version} + + + commons-cli + commons-cli + + + io.kubernetes + client-java-cert-manager-models + 10.0.1 + + + io.kubernetes + client-java-prometheus-operator-models + 10.0.1 + + + + junit + junit + test + + + com.github.tomakehurst + wiremock + test + + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-actuator + ${spring.boot.version} + + + com.amazonaws + aws-java-sdk-sts + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java new file mode 100644 index 0000000000..7f753b8d8f --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Attach; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" + * + *

From inside $REPO_DIR/examples + */ +public class AttachExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Attach attach = new Attach(); + final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); + + new Thread( + new Runnable() { + public void run() { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + OutputStream output = result.getStandardInputStream(); + try { + while (true) { + String line = in.readLine(); + output.write(line.getBytes()); + output.write('\n'); + output.flush(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getStandardOutputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + result.close(); + System.exit(0); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java new file mode 100644 index 0000000000..b616a18ee9 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; +import io.cert.manager.models.V1beta1Issuer; +import io.cert.manager.models.V1beta1IssuerList; +import io.cert.manager.models.V1beta1IssuerSpec; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +/** + * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a + * Kubernetes cluster where cert-manager is installed + */ +public class CertManagerExample { + public static void main(String[] args) throws IOException { + GenericKubernetesApi issuerApi = + new GenericKubernetesApi<>( + V1beta1Issuer.class, + V1beta1IssuerList.class, + "cert-manager.io", + "v1beta1", + "issuers", + ClientBuilder.defaultClient()); + issuerApi.create( + new V1beta1Issuer() + .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) + .kind("Issuer") + .apiVersion("cert-manager.io/v1beta1") + .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java new file mode 100644 index 0000000000..07e539e854 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java @@ -0,0 +1,164 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.ControllerManager; +import io.kubernetes.client.extended.controller.LeaderElectingController; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.extended.event.EventType; +import io.kubernetes.client.extended.event.legacy.EventBroadcaster; +import io.kubernetes.client.extended.event.legacy.EventRecorder; +import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1EventSource; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.util.CallGeneratorParams; +import java.io.IOException; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +public class ControllerExample { + public static void main(String[] args) throws IOException { + + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + // instantiating an informer-factory, and there should be only one informer-factory + // globally. + SharedInformerFactory informerFactory = new SharedInformerFactory(); + // registering node-informer into the informer-factory. + SharedIndexInformer nodeInformer = + informerFactory.sharedIndexInformerFor( + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + informerFactory.startAllRegisteredInformers(); + + EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); + + // nodeReconciler prints node information on events + NodePrintingReconciler nodeReconciler = + new NodePrintingReconciler( + nodeInformer, + eventBroadcaster.newRecorder( + new V1EventSource().host("localhost").component("node-printer"))); + + // Use builder library to construct a default controller. + Controller controller = + ControllerBuilder.defaultBuilder(informerFactory) + .watch( + (workQueue) -> + ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) + .withWorkQueueKeyFunc( + (V1Node node) -> + new Request(node.getMetadata().getName())) // optional, default to + .withOnAddFilter( + (V1Node createdNode) -> + createdNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onAdd filter + .withOnUpdateFilter( + (V1Node oldNode, V1Node newNode) -> + newNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onUpdate filter + .withOnDeleteFilter( + (V1Node deletedNode, Boolean stateUnknown) -> + deletedNode + .getMetadata() + .getName() + .startsWith("docker-")) // optional, set onDelete filter + .build()) + .withReconciler(nodeReconciler) // required, set the actual reconciler + .withName("node-printing-controller") // optional, set name for controller + .withWorkerCount(4) // optional, set worker thread count + .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the + // cache has synced up + .build(); + + // Use builder library to manage one or multiple controllers. + ControllerManager controllerManager = + ControllerBuilder.controllerManagerBuilder(informerFactory) + .addController(controller) + .build(); + + LeaderElectingController leaderElectingController = + new LeaderElectingController( + new LeaderElector( + new LeaderElectionConfig( + new EndpointsLock("kube-system", "leader-election", "foo"), + Duration.ofMillis(10000), + Duration.ofMillis(8000), + Duration.ofMillis(5000))), + controllerManager); + + leaderElectingController.run(); + } + + static class NodePrintingReconciler implements Reconciler { + + private Lister nodeLister; + private EventRecorder eventRecorder; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, EventRecorder recorder) { + this.nodeLister = new Lister<>(nodeInformer.getIndexer()); + this.eventRecorder = recorder; + } + + @Override + public Result reconcile(Request request) { + V1Node node = this.nodeLister.get(request.getName()); + System.out.println("triggered reconciling " + node.getMetadata().getName()); + this.eventRecorder.event( + node, + EventType.Normal, + "Print Node", + "Successfully printed %s", + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java new file mode 100644 index 0000000000..bbb6575676 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Copy; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import io.kubernetes.client.util.exception.CopyNotSupportedException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" + * + *

From inside $REPO_DIR/examples + */ +public class CopyExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, CopyNotSupportedException { + String podName = "kube-addon-manager-minikube"; + String namespace = "kube-system"; + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Copy copy = new Copy(); + InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); + Streams.copy(dataStream, System.out); + + copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); + + System.out.println("Done!"); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java new file mode 100644 index 0000000000..42a2524f7b --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java @@ -0,0 +1,140 @@ +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentBuilder; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1LabelSelector; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.openapi.models.V1PodTemplateSpec; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.PatchUtils; +import io.kubernetes.client.util.wait.Wait; +import java.io.IOException; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.Collections; + +public class DeployRolloutRestartExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + AppsV1Api appsV1Api = new AppsV1Api(client); + + String deploymentName = "example-nginx"; + String imageName = "nginx:1.21.6"; + String namespace = "default"; + + // Create an example deployment + V1DeploymentBuilder deploymentBuilder = + new V1DeploymentBuilder() + .withApiVersion("apps/v1") + .withKind("Deployment") + .withMetadata(new V1ObjectMeta().name(deploymentName).namespace(namespace)) + .withSpec( + new V1DeploymentSpec() + .replicas(1) + .selector(new V1LabelSelector().putMatchLabelsItem("name", deploymentName)) + .template( + new V1PodTemplateSpec() + .metadata(new V1ObjectMeta().putLabelsItem("name", deploymentName)) + .spec( + new V1PodSpec() + .containers( + Collections.singletonList( + new V1Container() + .name(deploymentName) + .image(imageName)))))); + appsV1Api.createNamespacedDeployment( + namespace, deploymentBuilder.build(), null, null, null, null); + + // Wait until example deployment is ready + Wait.poll( + Duration.ofSeconds(3), + Duration.ofSeconds(60), + () -> { + try { + System.out.println("Waiting until example deployment is ready..."); + return appsV1Api + .readNamespacedDeployment(deploymentName, namespace, null) + .getStatus() + .getReadyReplicas() + > 0; + } catch (ApiException e) { + e.printStackTrace(); + return false; + } + }); + System.out.println("Created example deployment!"); + + // Trigger a rollout restart of the example deployment + V1Deployment runningDeployment = + appsV1Api.readNamespacedDeployment(deploymentName, namespace, null); + + // Explicitly set "restartedAt" annotation with current date/time to trigger rollout when patch + // is applied + runningDeployment + .getSpec() + .getTemplate() + .getMetadata() + .putAnnotationsItem("kubectl.kubernetes.io/restartedAt", LocalDateTime.now().toString()); + try { + String deploymentJson = client.getJSON().serialize(runningDeployment); + + PatchUtils.patch( + V1Deployment.class, + () -> + appsV1Api.patchNamespacedDeploymentCall( + deploymentName, + namespace, + new V1Patch(deploymentJson), + null, + null, + "kubectl-rollout", + null, + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + client); + + // Wait until deployment has stabilized after rollout restart + Wait.poll( + Duration.ofSeconds(3), + Duration.ofSeconds(60), + () -> { + try { + System.out.println("Waiting until example deployment restarted successfully..."); + return appsV1Api + .readNamespacedDeployment(deploymentName, namespace, null) + .getStatus() + .getReadyReplicas() + > 0; + } catch (ApiException e) { + e.printStackTrace(); + return false; + } + }); + System.out.println("Example deployment restarted successfully!"); + } catch (ApiException e) { + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java new file mode 100644 index 0000000000..b8cb04616d --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; +import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; +import java.io.IOException; + +public class DynamicClientExample { + + public static void main(String[] args) throws IOException, ApiException { + + ApiClient apiClient = ClientBuilder.standard().build(); + + // retrieving the latest state of the default namespace + DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); + DynamicKubernetesObject defaultNamespace = + dynamicApi.get("default").throwsApiException().getObject(); + + // attaching a "foo=bar" label to the default namespace + defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); + DynamicKubernetesObject updatedDefaultNamespace = + dynamicApi.update(defaultNamespace).throwsApiException().getObject(); + + System.out.println(updatedDefaultNamespace); + + apiClient.getHttpClient().connectionPool().evictAll(); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java new file mode 100644 index 0000000000..e1e6610a2a --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java @@ -0,0 +1,53 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; +import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.VersionInfo; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.credentials.EKSAuthentication; +import io.kubernetes.client.util.version.Version; + +import java.io.IOException; + +public class EKSAuthenticationExample { + public static void main(String[] args) throws IOException, ApiException { + + // Connecting an EKS cluster using {@link io.kubernetes.client.util.credentials.EKSAuthentication } + + // This role should have access to the EKS cluster. + String roleArn = "arn:aws:iam::123456789:role/TestRole"; + // Arbitrary role session name. + String roleSessionName = "test"; + // Region where the EKS cluster at. + String region = "us-west-2"; + // EKS cluster name. + String clusterName = "test-2"; + + STSAssumeRoleSessionCredentialsProvider credProvider = new STSAssumeRoleSessionCredentialsProvider( + new DefaultAWSCredentialsProviderChain().getCredentials(), + roleArn, + roleSessionName); + + ApiClient apiClient = ClientBuilder.standard() + .setAuthentication(new EKSAuthentication(credProvider, region, clusterName)) + .build(); + + Version version = new Version(apiClient); + VersionInfo versionInfo = version.getVersion(); + System.out.println(versionInfo); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java new file mode 100644 index 0000000000..ef97e240d1 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.Example" + * + *

From inside $REPO_DIR/examples + */ +public class Example { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java new file mode 100644 index 0000000000..acea8e815a --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java @@ -0,0 +1,96 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Exec; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExecExample { + public static void main(String[] args) + throws IOException, ApiException, InterruptedException, ParseException { + final Options options = new Options(); + options.addOption(new Option("p", "pod", true, "The name of the pod")); + options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); + + CommandLineParser parser = new DefaultParser(); + CommandLine cmd = parser.parse(options, args); + + String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); + String namespace = cmd.getOptionValue("n", "default"); + args = cmd.getArgs(); + + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Exec exec = new Exec(); + boolean tty = System.console() != null; + // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] + // {"sh", "-c", "echo foo"}, true, tty); + final Process proc = + exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); + + Thread in = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(System.in, proc.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + in.start(); + + Thread out = + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(proc.getInputStream(), System.out); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + out.start(); + + proc.waitFor(); + + // wait for any last output; no need to wait for input thread + out.join(); + + proc.destroy(); + + System.exit(proc.exitValue()); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java new file mode 100644 index 0000000000..cea509a0fc --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java @@ -0,0 +1,278 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1DeploymentList; +import io.kubernetes.client.openapi.models.V1DeploymentSpec; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1ServiceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" + * + *

From inside $REPO_DIR/examples + */ +public class ExpandedExample { + + private static CoreV1Api COREV1_API; + private static final String DEFAULT_NAME_SPACE = "default"; + private static final Integer TIME_OUT_VALUE = 180; + private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); + + /** + * Main method + * + * @param args + */ + public static void main(String[] args) { + try { + ApiClient client = Config.defaultClient(); + // To change the context of k8s cluster, you can use + // io.kubernetes.client.util.KubeConfig + Configuration.setDefaultApiClient(client); + COREV1_API = new CoreV1Api(client); + + // ScaleUp/ScaleDown the Deployment pod + // Please change the name of Deployment? + System.out.println("----- Scale Deployment Start -----"); + scaleDeployment("account-service", 5); + + // List all of the namaspaces and pods + List nameSpaces = getAllNameSpaces(); + nameSpaces.stream() + .forEach( + namespace -> { + try { + System.out.println("----- " + namespace + " -----"); + getNamespacedPod(namespace).stream().forEach(System.out::println); + } catch (ApiException ex) { + LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); + } + }); + + // Print all of the Services + System.out.println("----- Print list all Services Start -----"); + List services = getServices(); + services.stream().forEach(System.out::println); + System.out.println("----- Print list all Services End -----"); + + // Print log of specific pod. In this example show the first pod logs. + System.out.println("----- Print Log of Specific Pod Start -----"); + String firstPodName = getPods().get(0); + printLog(DEFAULT_NAME_SPACE, firstPodName); + System.out.println("----- Print Log of Specific Pod End -----"); + } catch (ApiException | IOException ex) { + LOGGER.warn("Exception had occured ", ex); + } + } + + /** + * Get all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getAllNameSpaces() throws ApiException { + V1NamespaceList listNamespace = + COREV1_API.listNamespace( + null, null, null, null, null, null, null, null, null, null, null); + List list = + listNamespace.getItems().stream() + .map(v1Namespace -> v1Namespace.getMetadata().getName()) + .collect(Collectors.toList()); + return list; + } + + /** + * List all pod names in all namespaces in k8s cluster + * + * @return + * @throws ApiException + */ + public static List getPods() throws ApiException { + V1PodList v1podList = + COREV1_API.listPodForAllNamespaces( + null, null, null, null, null, null, null, null, null, null, null); + List podList = + v1podList.getItems().stream() + .map(v1Pod -> v1Pod.getMetadata().getName()) + .collect(Collectors.toList()); + return podList; + } + + /** + * List all pod in the default namespace + * + * @return + * @throws ApiException + */ + public static List getNamespacedPod() throws ApiException { + return getNamespacedPod(DEFAULT_NAME_SPACE, null); + } + + /** + * List pod in specific namespace + * + * @param namespace + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace) throws ApiException { + return getNamespacedPod(namespace, null); + } + + /** + * List pod in specific namespace with label + * + * @param namespace + * @param label + * @return + * @throws ApiException + */ + public static List getNamespacedPod(String namespace, String label) throws ApiException { + V1PodList listNamespacedPod = + COREV1_API.listNamespacedPod( + namespace, + null, + null, + null, + null, + label, + null, + null, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + List listPods = + listNamespacedPod.getItems().stream() + .map(v1pod -> v1pod.getMetadata().getName()) + .collect(Collectors.toList()); + return listPods; + } + + /** + * List all Services in default namespace + * + * @return + * @throws ApiException + */ + public static List getServices() throws ApiException { + V1ServiceList listNamespacedService = + COREV1_API.listNamespacedService( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + null, + TIME_OUT_VALUE, + Boolean.FALSE); + return listNamespacedService.getItems().stream() + .map(v1service -> v1service.getMetadata().getName()) + .collect(Collectors.toList()); + } + + /** + * Scale up/down the number of pod in Deployment + * + * @param deploymentName + * @param numberOfReplicas + * @throws ApiException + */ + public static void scaleDeployment(String deploymentName, int numberOfReplicas) + throws ApiException { + AppsV1Api appsV1Api = new AppsV1Api(); + appsV1Api.setApiClient(COREV1_API.getApiClient()); + V1DeploymentList listNamespacedDeployment = + appsV1Api.listNamespacedDeployment( + DEFAULT_NAME_SPACE, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + Boolean.FALSE); + + List appsV1DeploymentItems = listNamespacedDeployment.getItems(); + Optional findedDeployment = + appsV1DeploymentItems.stream() + .filter( + (V1Deployment deployment) -> + deployment.getMetadata().getName().equals(deploymentName)) + .findFirst(); + findedDeployment.ifPresent( + (V1Deployment deploy) -> { + try { + V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); + V1Deployment newDeploy = deploy.spec(newSpec); + appsV1Api.replaceNamespacedDeployment( + deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); + } catch (ApiException ex) { + LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); + } + }); + } + + /** + * Print out the Log for specific Pods + * + * @param namespace + * @param podName + * @throws ApiException + */ + public static void printLog(String namespace, String podName) throws ApiException { + // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog + String readNamespacedPodLog = + COREV1_API.readNamespacedPodLog( + podName, + namespace, + null, + Boolean.FALSE, + null, + Integer.MAX_VALUE, + null, + Boolean.FALSE, + Integer.MAX_VALUE, + null, + 40, + Boolean.FALSE); + System.out.println(readNamespacedPodLog); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java new file mode 100644 index 0000000000..3357ac2f00 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.Arrays; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" + * + *

From inside $REPO_DIR/examples + */ +public class FluentExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .endContainer() + .endSpec() + .build(); + + api.createNamespacedPod("default", pod, null, null, null, null); + + V1Pod pod2 = + new V1Pod() + .metadata(new V1ObjectMeta().name("anotherpod")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); + + api.createNamespacedPod("default", pod2, null, null, null, null); + + V1PodList list = + api.listNamespacedPod( + "default", null, null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java new file mode 100644 index 0000000000..ddfb1243b8 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java @@ -0,0 +1,63 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Container; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodSpec; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.util.Arrays; + +public class GenericClientExample { + + public static void main(String[] args) throws Exception { + + // The following codes demonstrates using generic client to manipulate pods + V1Pod pod = + new V1Pod() + .metadata(new V1ObjectMeta().name("foo").namespace("default")) + .spec( + new V1PodSpec() + .containers(Arrays.asList(new V1Container().name("c").image("test")))); + + ApiClient apiClient = ClientBuilder.standard().build(); + GenericKubernetesApi podClient = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + + V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); + System.out.println("Created!"); + + V1Pod patchedPod = + podClient + .patch( + "default", + "foo", + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) + .throwsApiException() + .getObject(); + System.out.println("Patched!"); + + V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); + if (deletedPod != null) { + System.out.println( + "Received after-deletion status of the requested object, will be deleting in background!"); + } + System.out.println("Deleted!"); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java new file mode 100644 index 0000000000..0d6134bb68 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import java.io.IOException; + +/** + * A simple example of how to use the Java API inside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class InClusterClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // loading the in-cluster config, including: + // 1. service-account CA + // 2. service-account bearer-token + // 3. service-account namespace + // 4. master endpoints(ip, port) from pre-set environment variables + ApiClient client = ClientBuilder.cluster().build(); + + // if you prefer not to refresh service account token, please use: + // ApiClient client = ClientBuilder.oldCluster().build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java new file mode 100644 index 0000000000..a82e81bfde --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java @@ -0,0 +1,107 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.informer.ResourceEventHandler; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.CallGeneratorParams; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" + * + *

From inside $REPO_DIR/examples + */ +public class InformerExample { + public static void main(String[] args) throws Exception { + CoreV1Api coreV1Api = new CoreV1Api(); + ApiClient apiClient = coreV1Api.getApiClient(); + OkHttpClient httpClient = + apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + apiClient.setHttpClient(httpClient); + + SharedInformerFactory factory = new SharedInformerFactory(apiClient); + + // Node informer + SharedIndexInformer nodeInformer = + factory.sharedIndexInformerFor( + // **NOTE**: + // The following "CallGeneratorParams" lambda merely generates a stateless + // HTTPs requests, the effective apiClient is the one specified when constructing + // the informer-factory. + (CallGeneratorParams params) -> { + return coreV1Api.listNodeCall( + null, + null, + null, + null, + null, + null, + params.resourceVersion, + null, + null, + params.timeoutSeconds, + params.watch, + null); + }, + V1Node.class, + V1NodeList.class); + + nodeInformer.addEventHandler( + new ResourceEventHandler() { + @Override + public void onAdd(V1Node node) { + System.out.printf("%s node added!\n", node.getMetadata().getName()); + } + + @Override + public void onUpdate(V1Node oldNode, V1Node newNode) { + System.out.printf( + "%s => %s node updated!\n", + oldNode.getMetadata().getName(), newNode.getMetadata().getName()); + } + + @Override + public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { + System.out.printf("%s node deleted!\n", node.getMetadata().getName()); + } + }); + + factory.startAllRegisteredInformers(); + + V1Node nodeToCreate = new V1Node(); + V1ObjectMeta metadata = new V1ObjectMeta(); + metadata.setName("noxu"); + nodeToCreate.setMetadata(metadata); + V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); + Thread.sleep(3000); + + Lister nodeLister = new Lister(nodeInformer.getIndexer()); + V1Node node = nodeLister.get("noxu"); + System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); + factory.stopAllRegisteredInformers(); + Thread.sleep(3000); + System.out.println("informer stopped.."); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java new file mode 100644 index 0000000000..0aa8ae8e13 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.KubeConfig; +import java.io.FileReader; +import java.io.IOException; + +/** + * A simple example of how to use the Java API from an application outside a kubernetes cluster + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" + * + *

From inside $REPO_DIR/examples + */ +public class KubeConfigFileClientExample { + public static void main(String[] args) throws IOException, ApiException { + + // file path to your KubeConfig + + String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; + + // loading the out-of-cluster config, a kubeconfig from file-system + ApiClient client = + ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); + + // set the global default api-client to the in-cluster one from above + Configuration.setDefaultApiClient(client); + + // the CoreV1Api loads default api-client from global configuration. + CoreV1Api api = new CoreV1Api(); + + // invokes the CoreV1Api client + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); + for (V1Pod item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java new file mode 100644 index 0000000000..2619c9f271 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java @@ -0,0 +1,311 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; +import static io.kubernetes.client.extended.kubectl.Kubectl.copy; +import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.delete; +import static io.kubernetes.client.extended.kubectl.Kubectl.drain; +import static io.kubernetes.client.extended.kubectl.Kubectl.exec; +import static io.kubernetes.client.extended.kubectl.Kubectl.label; +import static io.kubernetes.client.extended.kubectl.Kubectl.log; +import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; +import static io.kubernetes.client.extended.kubectl.Kubectl.scale; +import static io.kubernetes.client.extended.kubectl.Kubectl.taint; +import static io.kubernetes.client.extended.kubectl.Kubectl.top; +import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; +import static io.kubernetes.client.extended.kubectl.Kubectl.version; +import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; + +import io.kubernetes.client.common.KubernetesObject; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.extended.kubectl.KubectlExec; +import io.kubernetes.client.extended.kubectl.KubectlPortForward; +import io.kubernetes.client.extended.kubectl.exception.KubectlException; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1ReplicationController; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.tuple.Pair; + +/** + * A Java equivalent for the kubectl command line tool. Not nearly as complete. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" + * + *

From inside $REPO_DIR/examples + */ +public class KubectlExample { + static Class getClassForKind(String kind) { + switch (kind) { + case "pod": + case "pods": + return V1Pod.class; + case "deployment": + case "deployments": + return V1Deployment.class; + case "service": + case "services": + return V1Service.class; + case "node": + case "nodes": + return V1Node.class; + case "replicationcontroller": + case "replicationcontrollers": + return V1ReplicationController.class; + } + return null; + } + + private static final String PADDING = " "; + + private static String pad(String value) { + while (value.length() < PADDING.length()) { + value += " "; + } + return value; + } + + public static void main(String[] args) + throws java.io.IOException, KubectlException, ParseException { + ApiClient client = Config.defaultClient(); + + Options options = new Options(); + options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); + options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); + options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); + DefaultParser parser = new DefaultParser(); + CommandLine cli = parser.parse(options, args); + + args = cli.getArgs(); + String verb = args[0]; + String ns = cli.getOptionValue("n", "default"); + String kind = null; + String name = null; + + switch (verb) { + case "delete": + kind = args[1]; + name = args[2]; + delete(getClassForKind(kind)).namespace(ns).name(name).execute(); + case "drain": + name = args[1]; + drain().apiClient(client).name(name).execute(); + System.out.println("Node drained"); + System.exit(0); + case "cordon": + name = args[1]; + cordon().apiClient(client).name(name).execute(); + System.out.println("Node cordoned"); + System.exit(0); + case "uncordon": + name = args[1]; + uncordon().apiClient(client).name(name).execute(); + System.out.println("Node uncordoned"); + System.exit(0); + case "top": + String what = args[1]; + switch (what) { + case "nodes": + case "node": + List> nodes = + top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); + System.out.println(pad("Node") + "\tCPU\t\tMemory"); + for (Pair node : nodes) { + System.out.println( + pad(node.getLeft().getMetadata().getName()) + + "\t" + + node.getRight().getUsage().get("cpu").getNumber() + + "\t" + + node.getRight().getUsage().get("memory").getNumber()); + } + System.exit(0); + case "pods": + case "pod": + List> pods = + top(V1Pod.class, PodMetrics.class) + .apiClient(client) + .namespace(ns) + .metric("cpu") + .execute(); + System.out.println(pad("Pod") + "\tCPU\t\tMemory"); + for (Pair pod : pods) { + System.out.println( + pad(pod.getLeft().getMetadata().getName()) + + "\t" + + podMetricSum(pod.getRight(), "cpu") + + "\t" + + podMetricSum(pod.getRight(), "memory")); + } + System.exit(0); + } + System.err.println("Unknown top argument: " + what); + System.exit(-1); + case "cp": + String from = args[1]; + String to = args[2]; + if (from.indexOf(":") != -1) { + String[] parts = from.split(":"); + name = parts[0]; + from = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .fromPod(from) + .to(to) + .execute(); + } else if (to.indexOf(":") != -1) { + String[] parts = to.split(":"); + name = parts[0]; + to = parts[1]; + copy() + .apiClient(client) + .namespace(ns) + .name(name) + .container(cli.getOptionValue("c", "")) + .from(from) + .toPod(to) + .execute(); + } else { + System.err.println("Missing pod name for copy."); + System.exit(-1); + } + System.out.println("Copied " + from + " -> " + to); + System.exit(0); + case "taint": + name = args[1]; + String taintSpec = args[2]; + boolean remove = taintSpec.endsWith("-"); + int ix = taintSpec.indexOf("="); + int ix2 = taintSpec.indexOf(":"); + + if (remove) { + taintSpec = taintSpec.substring(0, taintSpec.length() - 2); + String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); + String effect = ix == -1 ? null : taintSpec.substring(ix + 1); + + if (effect == null) { + taint().apiClient(client).name(name).removeTaint(key).execute(); + } else { + taint().apiClient(client).name(name).removeTaint(key, effect).execute(); + } + System.exit(0); + } + if (ix2 == -1) { + System.err.println("key:effect or key=value:effect is required."); + System.exit(-1); + } + String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); + String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); + String effect = taintSpec.substring(ix2 + 1); + + if (value == null) { + taint().apiClient(client).name(name).addTaint(key, effect).execute(); + } else { + taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); + } + System.exit(0); + case "portforward": + name = args[1]; + KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); + for (int i = 2; i < args.length; i++) { + String port = args[i]; + String[] ports = port.split(":"); + System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); + forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); + } + forward.execute(); + System.exit(0); + case "log": + name = args[1]; + Streams.copy( + log() + .apiClient(client) + .name(name) + .namespace(ns) + .container(cli.getOptionValue("c", "")) + .execute(), + System.out); + System.exit(0); + case "scale": + kind = args[1]; + name = args[2]; + if (!cli.hasOption("r")) { + System.err.println("--replicas is required"); + System.exit(-3); + } + int replicas = Integer.parseInt(cli.getOptionValue("r")); + scale(getClassForKind(kind)) + .apiClient(client) + .namespace(ns) + .name(name) + .replicas(replicas) + .execute(); + System.out.println("Deployment scaled."); + System.exit(0); + case "version": + System.out.println(version().apiClient(client)); + System.exit(0); + case "label": + kind = args[1]; + name = args[2]; + String labelKey = args[3]; + String labelValue = args[4]; + Class clazz = getClassForKind(kind); + if (clazz == null) { + System.err.println("Unknown kind: " + kind); + System.exit(-2); + } + label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); + System.exit(0); + case "exec": + name = args[1]; + String[] command = Arrays.copyOfRange(args, 2, args.length); + KubectlExec e = + exec() + .apiClient(client) + .namespace(ns) + .name(name) + .command(command) + .container(cli.getOptionValue("c", "")); + System.exit(e.execute()); + case "api-resources": + apiResources().apiClient(client).execute().stream() + .forEach( + r -> + System.out.printf( + "%s\t\t%s\t\t%s\t\t%s\n", + r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); + System.exit(0); + default: + System.out.println("Unknown verb: " + verb); + System.exit(-1); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java new file mode 100644 index 0000000000..0e48689602 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java @@ -0,0 +1,56 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; +import io.kubernetes.client.extended.leaderelection.LeaderElector; +import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.time.Duration; +import java.util.UUID; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" + * + *

From inside $REPO_DIR/examples + */ +public class LeaderElectionExample { + public static void main(String[] args) throws Exception { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // New + String appNamespace = "default"; + String appName = "leader-election-foobar"; + String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique + EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); + + LeaderElectionConfig leaderElectionConfig = + new LeaderElectionConfig( + lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); + try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { + leaderElector.run( + () -> { + System.out.println("Do something when getting leadership."); + }, + () -> { + System.out.println("Do something when losing leadership."); + }); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java new file mode 100644 index 0000000000..ec7d8cb44f --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java @@ -0,0 +1,51 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PodLogs; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.io.InputStream; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" + * + *

From inside $REPO_DIR/examples + */ +public class LogsExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + CoreV1Api coreApi = new CoreV1Api(client); + + PodLogs logs = new PodLogs(); + V1Pod pod = + coreApi + .listNamespacedPod( + "default", "false", null, null, null, null, null, null, null, null, null, null) + .getItems() + .get(0); + + InputStream is = logs.streamNamespacedPodLog(pod); + Streams.copy(is, System.out); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java new file mode 100644 index 0000000000..0d8c10e30b --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.Metrics; +import io.kubernetes.client.custom.ContainerMetrics; +import io.kubernetes.client.custom.NodeMetrics; +import io.kubernetes.client.custom.NodeMetricsList; +import io.kubernetes.client.custom.PodMetrics; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" + * + *

From inside $REPO_DIR/examples + */ +public class MetricsExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + Metrics metrics = new Metrics(client); + NodeMetricsList list = metrics.getNodeMetrics(); + for (NodeMetrics item : list.getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + for (String key : item.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + item.getUsage().get(key)); + } + System.out.println(); + } + + for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { + System.out.println(item.getMetadata().getName()); + System.out.println("------------------------------"); + if (item.getContainers() == null) { + continue; + } + for (ContainerMetrics container : item.getContainers()) { + System.out.println(container.getName()); + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + for (String key : container.getUsage().keySet()) { + System.out.println("\t" + key); + System.out.println("\t" + container.getUsage().get(key)); + } + System.out.println(); + } + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java new file mode 100644 index 0000000000..3153775ab7 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java @@ -0,0 +1,73 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.pager.Pager; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1NamespaceList; +import io.kubernetes.client.util.Config; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" + * + *

From inside $REPO_DIR/examples + */ +public class PagerExample { + public static void main(String[] args) throws IOException { + + ApiClient client = Config.defaultClient(); + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + CoreV1Api api = new CoreV1Api(); + int i = 0; + Pager pager = + new Pager( + (Pager.PagerParams param) -> { + try { + return api.listNamespaceCall( + null, + null, + param.getContinueToken(), + null, + null, + param.getLimit(), + null, + null, + null, + 1, + null, + null); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, + client, + 10, + V1NamespaceList.class); + for (V1Namespace namespace : pager) { + System.out.println(namespace.getMetadata().getName()); + } + System.out.println("------------------"); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java new file mode 100644 index 0000000000..92866a46fe --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java @@ -0,0 +1,64 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" + * + *

From inside $REPO_DIR/examples + */ +public class ParseExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + if (args.length < 2) { + System.err.println("Usage: ParseExample "); + System.exit(1); + } + ApiClient client = Config.defaultClient(); + FileReader json = new FileReader(args[0]); + Object obj = + client + .getJSON() + .getGson() + .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); + + String output = client.getJSON().getGson().toJson(obj); + + // Test round tripping... + Object obj2 = + client + .getJSON() + .getGson() + .fromJson( + new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); + + String output2 = client.getJSON().getGson().toJson(obj2); + + // Validate round trip + if (!output.equals(output2)) { + System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); + System.exit(2); + } + + System.out.println(output); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java new file mode 100644 index 0000000000..7eed3360d3 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java @@ -0,0 +1,130 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.AppsV1Api; +import io.kubernetes.client.openapi.models.V1Deployment; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.PatchUtils; +import java.io.IOException; + +/** + * A simple Example of how to use the Java API.
+ * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
+ * For generating Json Patches, refer http://jsonpatch.com. For + * generating Strategic Merge Patches, refer strategic-merge-patch.md. + * + *

    + *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a + * finalizer. + *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. + *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. + *
+ * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" + * + *

From inside $REPO_DIR/examples + */ +public class PatchExample { + static String jsonPatchStr = + "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; + static String strategicMergePatchStr = + "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; + static String jsonDeploymentStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + static String applyYamlStr = + "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; + + public static void main(String[] args) throws IOException { + try { + AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); + V1Deployment body = + Configuration.getDefaultApiClient() + .getJSON() + .deserialize(jsonDeploymentStr, V1Deployment.class); + + // create a deployment + V1Deployment deploy1 = + api.createNamespacedDeployment("default", body, null, null, null, null); + System.out.println("original deployment" + deploy1); + + // json-patch a deployment + V1Deployment deploy2 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(jsonPatchStr), + null, + null, + null, + null, // field-manager is optional + null, + null), + V1Patch.PATCH_FORMAT_JSON_PATCH, + api.getApiClient()); + System.out.println("json-patched deployment" + deploy2); + + // strategic-merge-patch a deployment + V1Deployment deploy3 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(strategicMergePatchStr), + null, + null, + null, // field-manager is optional + null, + null, + null), + V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, + api.getApiClient()); + System.out.println("strategic-merge-patched deployment" + deploy3); + + // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 + // or opt-in by turning on the feature gate for v1.14 or v1.15. + // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply + V1Deployment deploy4 = + PatchUtils.patch( + V1Deployment.class, + () -> + api.patchNamespacedDeploymentCall( + "hello-node", + "default", + new V1Patch(applyYamlStr), + null, + null, + "example-field-manager", // field-manager is required for server-side apply + null, + true, + null), + V1Patch.PATCH_FORMAT_APPLY_YAML, + api.getApiClient()); + System.out.println("application/apply-patch+yaml deployment" + deploy4); + + } catch (ApiException e) { + System.out.println(e.getResponseBody()); + e.printStackTrace(); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java new file mode 100644 index 0000000000..cbe064db31 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.PortForward; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Streams; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.ArrayList; +import java.util.List; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside + * $REPO_DIR/examples + * + *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times + * out pretty fast...) + */ +public class PortForwardExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + PortForward forward = new PortForward(); + List ports = new ArrayList<>(); + int localPort = 8080; + int targetPort = 8080; + ports.add(targetPort); + final PortForward.PortForwardResult result = + forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); + System.out.println("Forwarding!"); + ServerSocket ss = new ServerSocket(localPort); + + final Socket s = ss.accept(); + System.out.println("Connected!"); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + new Thread( + new Runnable() { + public void run() { + try { + Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); + } catch (IOException ex) { + ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }) + .start(); + + Thread.sleep(10 * 1000); + + System.exit(0); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java new file mode 100644 index 0000000000..65f38b8ce4 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java @@ -0,0 +1,43 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.coreos.monitoring.models.V1Prometheus; +import com.coreos.monitoring.models.V1PrometheusList; +import com.coreos.monitoring.models.V1PrometheusSpec; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.util.ClientBuilder; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.io.IOException; + +public class PromOpExample { + public static void main(String[] args) throws IOException, ApiException { + GenericKubernetesApi prometheusApi = + new GenericKubernetesApi<>( + V1Prometheus.class, + V1PrometheusList.class, + "monitoring.coreos.com", + "v1", + "prometheuses", + ClientBuilder.defaultClient()); + prometheusApi + .create( + new V1Prometheus() + .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) + .kind("Prometheus") + .apiVersion("monitoring.coreos.com/v1") + .spec(new V1PrometheusSpec())) + .throwsApiException(); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java new file mode 100644 index 0000000000..e3c6c9daaf --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java @@ -0,0 +1,66 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.monitoring.Monitoring; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API with Prometheus metrics + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" + * + *

From inside $REPO_DIR/examples + */ +public class PrometheusExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // Install an HTTP Interceptor that adds metrics + Monitoring.installMetrics(client); + + // Install a simple HTTP server to serve prometheus metrics. If you already are serving + // metrics elsewhere, this is unnecessary. + Monitoring.startMetricsServer("localhost", 8080); + + CoreV1Api api = new CoreV1Api(); + + while (true) { + // A request that should return 200 + V1PodList list = + api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); + // A request that should return 404 + try { + V1Pod pod = api.readNamespacedPod("foo", "bar", null); + } catch (ApiException ex) { + if (ex.getCode() != 404) { + throw ex; + } + } + try { + Thread.sleep(10000); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java new file mode 100644 index 0000000000..e4e05a2aa1 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java @@ -0,0 +1,69 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.ProtoClient; +import io.kubernetes.client.ProtoClient.ObjectOrStatus; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.proto.Meta.ObjectMeta; +import io.kubernetes.client.proto.V1.Namespace; +import io.kubernetes.client.proto.V1.NamespaceSpec; +import io.kubernetes.client.proto.V1.Pod; +import io.kubernetes.client.proto.V1.PodList; +import io.kubernetes.client.util.Config; +import java.io.IOException; + +/** + * A simple example of how to use the Java API + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" + * + *

From inside $REPO_DIR/examples + */ +public class ProtoExample { + public static void main(String[] args) throws IOException, ApiException, InterruptedException { + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + ProtoClient pc = new ProtoClient(client); + ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); + + if (list.object.getItemsCount() > 0) { + Pod p = list.object.getItems(0); + System.out.println(p); + } + + Namespace namespace = + Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); + + ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); + System.out.println(ns); + if (ns.object != null) { + namespace = + ns.object + .toBuilder() + .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) + .build(); + // This is how you would update an object, but you can't actually + // update namespaces, so this returns a 405 + ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); + System.out.println(ns.status); + } + + ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); + System.out.println(ns); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java new file mode 100644 index 0000000000..f6494a836e --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java @@ -0,0 +1,147 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.controller.Controller; +import io.kubernetes.client.extended.controller.builder.ControllerBuilder; +import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; +import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import io.kubernetes.client.extended.controller.reconciler.Request; +import io.kubernetes.client.extended.controller.reconciler.Result; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.openapi.models.V1EndpointsList; +import io.kubernetes.client.openapi.models.V1Node; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.generic.GenericKubernetesApi; +import java.time.Duration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + +@SpringBootApplication +public class SpringControllerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringControllerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner commandLineRunner( + SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("running controller.."); + nodePrintingController.run(); + }; + } + + @Bean + public Controller nodePrintingController( + SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { + DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); + builder = + builder.watch( + (q) -> { + return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) + .withResyncPeriod(Duration.ofMinutes(1)) + .build(); + }); + builder.withWorkerCount(2); + builder.withReadyFunc(reconciler::informerReady); + return builder.withReconciler(reconciler).withName("nodePrintingController").build(); + } + + @Bean + public SharedIndexInformer endpointsInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>( + V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); + } + + @Bean + public SharedIndexInformer nodeInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); + } + + @Bean + public SharedIndexInformer podInformer( + ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { + GenericKubernetesApi genericApi = + new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); + return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); + } + } + + @Component + public static class NodePrintingReconciler implements Reconciler { + + @Value("${namespace}") + private String namespace; + + private SharedInformer nodeInformer; + + private SharedInformer podInformer; + + private Lister nodeLister; + + private Lister podLister; + + public NodePrintingReconciler( + SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { + this.nodeInformer = nodeInformer; + this.podInformer = podInformer; + this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); + this.podLister = new Lister<>(podInformer.getIndexer(), namespace); + } + + // *OPTIONAL* + // If you want to hold the controller from running util some condition.. + public boolean informerReady() { + return podInformer.hasSynced() && nodeInformer.hasSynced(); + } + + @Override + public Result reconcile(Request request) { + V1Node node = nodeLister.get(request.getName()); + + System.out.println("get all pods in namespace " + namespace); + podLister.namespace(namespace).list().stream() + .map(pod -> pod.getMetadata().getName()) + .forEach(System.out::println); + + System.out.println("triggered reconciling " + node.getMetadata().getName()); + return new Result(false); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java new file mode 100644 index 0000000000..bafe11e421 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.extended.network.EndpointsLoadBalancer; +import io.kubernetes.client.extended.network.LoadBalancer; +import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; +import io.kubernetes.client.informer.SharedIndexInformer; +import io.kubernetes.client.informer.SharedInformerFactory; +import io.kubernetes.client.informer.cache.Lister; +import io.kubernetes.client.openapi.models.V1Endpoints; +import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class SpringLoadBalancerExample { + + public static void main(String[] args) { + SpringApplication.run(SpringLoadBalancerExample.class, args); + } + + @Configuration + public static class AppConfig { + + @Bean + public CommandLineRunner loadBalancerCommandLineRunner( + SharedInformerFactory sharedInformerFactory, MyService myService) { + return args -> { + System.out.println("starting informers.."); + sharedInformerFactory.startAllRegisteredInformers(); + + System.out.println("routing default/kubernetes:"); + System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); + }; + } + + @Bean + public MyService myService(SharedIndexInformer lister) { + return new MyService(new Lister<>(lister.getIndexer())); + } + } + + public static class MyService { + + private LoadBalancer defaultKubernetesLoadBalancer; + + public MyService(Lister lister) { + InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); + RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); + defaultKubernetesLoadBalancer = + new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java new file mode 100644 index 0000000000..786f84f7bd --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java @@ -0,0 +1,54 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import com.google.gson.reflect.TypeToken; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Watch; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** A simple example of how to use Watch API to watch changes in Namespace list. */ +public class WatchExample { + public static void main(String[] args) throws IOException, ApiException { + ApiClient client = Config.defaultClient(); + // infinite timeout + OkHttpClient httpClient = + client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); + client.setHttpClient(httpClient); + Configuration.setDefaultApiClient(client); + + CoreV1Api api = new CoreV1Api(); + + Watch watch = + Watch.createWatch( + client, + api.listNamespaceCall( + null, null, null, null, null, null, null, null, null, null, Boolean.TRUE, null), + new TypeToken>() {}.getType()); + + try { + for (Watch.Response item : watch) { + System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); + } + } finally { + watch.close(); + } + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java new file mode 100644 index 0000000000..e1f54dcd07 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java @@ -0,0 +1,74 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.WebSockets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import okhttp3.WebSocket; + +/** + * This is a pretty low level, most people won't need to use WebSockets directly. + * + *

If you do need to run it, you can run: mvn exec:java \ + * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ + * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true + * + *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP + * GET calls. + */ +public class WebSocketsExample { + public static void main(String... args) throws ApiException, IOException { + final ApiClient client = Config.defaultClient(); + WebSockets.stream( + args[0], + "GET", + client, + new WebSockets.SocketListener() { + private volatile WebSocket socket; + + @Override + public void open(String protocol, WebSocket socket) { + this.socket = socket; + } + + @Override + public void close() {} + + @Override + public void bytesMessage(InputStream is) {} + + @Override + public void failure(Throwable t) { + t.printStackTrace(); + } + + @Override + public void textMessage(Reader in) { + try { + BufferedReader reader = new BufferedReader(in); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + System.out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + }); + } +} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java new file mode 100644 index 0000000000..9e12aa6f84 --- /dev/null +++ b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java @@ -0,0 +1,110 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import io.kubernetes.client.custom.IntOrString; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodBuilder; +import io.kubernetes.client.openapi.models.V1Service; +import io.kubernetes.client.openapi.models.V1ServiceBuilder; +import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.Yaml; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * A simple example of how to parse a Kubernetes object. + * + *

Easiest way to run this: mvn exec:java + * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" + * + *

From inside $REPO_DIR/examples + */ +public class YamlExample { + public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { + V1Pod pod = + new V1PodBuilder() + .withNewMetadata() + .withName("apod") + .endMetadata() + .withNewSpec() + .addNewContainer() + .withName("www") + .withImage("nginx") + .withNewResources() + .withLimits(new HashMap<>()) + .endResources() + .endContainer() + .endSpec() + .build(); + System.out.println(Yaml.dump(pod)); + + V1Service svc = + new V1ServiceBuilder() + .withNewMetadata() + .withName("aservice") + .endMetadata() + .withNewSpec() + .withSessionAffinity("ClientIP") + .withType("NodePort") + .addNewPort() + .withProtocol("TCP") + .withName("client") + .withPort(8008) + .withNodePort(8080) + .withTargetPort(new IntOrString(8080)) + .endPort() + .endSpec() + .build(); + System.out.println(Yaml.dump(svc)); + + // Read yaml configuration file, and deploy it + ApiClient client = Config.defaultClient(); + Configuration.setDefaultApiClient(client); + + // See issue #474. Not needed at most cases, but it is needed if you are using war + // packging or running this on JUnit. + Yaml.addModelMap("v1", "Service", V1Service.class); + + // Example yaml file can be found in $REPO_DIR/test-svc.yaml + File file = new File("test-svc.yaml"); + V1Service yamlSvc = (V1Service) Yaml.load(file); + + // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of + // CoreV1API + CoreV1Api api = new CoreV1Api(); + V1Service createResult = + api.createNamespacedService("default", yamlSvc, null, null, null, null); + + System.out.println(createResult); + + V1Service deleteResult = + api.deleteNamespacedService( + yamlSvc.getMetadata().getName(), + "default", + null, + null, + null, + null, + null, + null, + new V1DeleteOptions()); + System.out.println(deleteResult); + } +} diff --git a/examples/examples-release-19/src/main/resources/application.properties b/examples/examples-release-19/src/main/resources/application.properties new file mode 100644 index 0000000000..dc886e5f48 --- /dev/null +++ b/examples/examples-release-19/src/main/resources/application.properties @@ -0,0 +1,2 @@ +namespace=airflow +management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java new file mode 100644 index 0000000000..df2f168e41 --- /dev/null +++ b/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.examples; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.junit.Assert.assertEquals; + +import com.github.tomakehurst.wiremock.junit.WireMockRule; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1Namespace; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; + +public class ExampleTest { + private static final int PORT = 8089; + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); + + @Test + public void exactUrlOnly() throws IOException, ApiException { + ApiClient client = new ApiClient(); + client.setBasePath("http://localhost:" + PORT); + Configuration.setDefaultApiClient(client); + + V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); + + stubFor( + get(urlEqualTo("/api/v1/namespaces/name")) + .willReturn( + aResponse() + .withHeader("Content-Type", "application/json") + .withBody(client.getJSON().serialize(ns1)))); + + CoreV1Api api = new CoreV1Api(); + V1Namespace ns2 = api.readNamespace("name", null); + assertEquals(ns1, ns2); + } +} diff --git a/examples/examples-release-19/test-svc.yaml b/examples/examples-release-19/test-svc.yaml new file mode 100644 index 0000000000..f225bea76f --- /dev/null +++ b/examples/examples-release-19/test-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: test-service +spec: + type: ClusterIP + selector: + app: test-service + ports: + - name: port-of-container + port: 8080 \ No newline at end of file diff --git a/examples/examples-release-19/test.yaml b/examples/examples-release-19/test.yaml new file mode 100644 index 0000000000..0b46e57003 --- /dev/null +++ b/examples/examples-release-19/test.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: test +spec: + replicas: 1 + template: + metadata: + labels: + app: test + spec: + containers: + - name: test + image: test/examples:1.0 + command: ["/bin/sh","-c"] + args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java new file mode 100644 index 0000000000..eeb1c72b63 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java @@ -0,0 +1,34 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1GroupVersionResourceBuilder extends V1alpha1GroupVersionResourceFluent implements VisitableBuilder{ + public V1alpha1GroupVersionResourceBuilder() { + this(new V1alpha1GroupVersionResource()); + } + + public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResourceFluent fluent) { + this(fluent, new V1alpha1GroupVersionResource()); + } + + public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResourceFluent fluent,V1alpha1GroupVersionResource instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResource instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1GroupVersionResourceFluent fluent; + + public V1alpha1GroupVersionResource build() { + V1alpha1GroupVersionResource buildable = new V1alpha1GroupVersionResource(); + buildable.setGroup(fluent.getGroup()); + buildable.setResource(fluent.getResource()); + buildable.setVersion(fluent.getVersion()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java new file mode 100644 index 0000000000..d92ea2a9cf --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java @@ -0,0 +1,122 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; +import java.lang.String; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1GroupVersionResourceFluent> extends BaseFluent{ + public V1alpha1GroupVersionResourceFluent() { + } + + public V1alpha1GroupVersionResourceFluent(V1alpha1GroupVersionResource instance) { + this.copyInstance(instance); + } + private String group; + private String resource; + private String version; + + protected void copyInstance(V1alpha1GroupVersionResource instance) { + instance = instance != null ? instance : new V1alpha1GroupVersionResource(); + if (instance != null) { + this.withGroup(instance.getGroup()); + this.withResource(instance.getResource()); + this.withVersion(instance.getVersion()); + } + } + + public String getGroup() { + return this.group; + } + + public A withGroup(String group) { + this.group = group; + return (A) this; + } + + public boolean hasGroup() { + return this.group != null; + } + + public String getResource() { + return this.resource; + } + + public A withResource(String resource) { + this.resource = resource; + return (A) this; + } + + public boolean hasResource() { + return this.resource != null; + } + + public String getVersion() { + return this.version; + } + + public A withVersion(String version) { + this.version = version; + return (A) this; + } + + public boolean hasVersion() { + return this.version != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1GroupVersionResourceFluent that = (V1alpha1GroupVersionResourceFluent) o; + if (!(Objects.equals(group, that.group))) { + return false; + } + if (!(Objects.equals(resource, that.resource))) { + return false; + } + if (!(Objects.equals(version, that.version))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(group, resource, version); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(group == null)) { + sb.append("group:"); + sb.append(group); + sb.append(","); + } + if (!(resource == null)) { + sb.append("resource:"); + sb.append(resource); + sb.append(","); + } + if (!(version == null)) { + sb.append("version:"); + sb.append(version); + } + sb.append("}"); + return sb.toString(); + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java new file mode 100644 index 0000000000..5bb338525d --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java @@ -0,0 +1,36 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1MigrationConditionBuilder extends V1alpha1MigrationConditionFluent implements VisitableBuilder{ + public V1alpha1MigrationConditionBuilder() { + this(new V1alpha1MigrationCondition()); + } + + public V1alpha1MigrationConditionBuilder(V1alpha1MigrationConditionFluent fluent) { + this(fluent, new V1alpha1MigrationCondition()); + } + + public V1alpha1MigrationConditionBuilder(V1alpha1MigrationConditionFluent fluent,V1alpha1MigrationCondition instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1MigrationConditionBuilder(V1alpha1MigrationCondition instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1MigrationConditionFluent fluent; + + public V1alpha1MigrationCondition build() { + V1alpha1MigrationCondition buildable = new V1alpha1MigrationCondition(); + buildable.setLastUpdateTime(fluent.getLastUpdateTime()); + buildable.setMessage(fluent.getMessage()); + buildable.setReason(fluent.getReason()); + buildable.setStatus(fluent.getStatus()); + buildable.setType(fluent.getType()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java new file mode 100644 index 0000000000..719d813778 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java @@ -0,0 +1,169 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.time.OffsetDateTime; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; +import java.lang.String; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1MigrationConditionFluent> extends BaseFluent{ + public V1alpha1MigrationConditionFluent() { + } + + public V1alpha1MigrationConditionFluent(V1alpha1MigrationCondition instance) { + this.copyInstance(instance); + } + private OffsetDateTime lastUpdateTime; + private String message; + private String reason; + private String status; + private String type; + + protected void copyInstance(V1alpha1MigrationCondition instance) { + instance = instance != null ? instance : new V1alpha1MigrationCondition(); + if (instance != null) { + this.withLastUpdateTime(instance.getLastUpdateTime()); + this.withMessage(instance.getMessage()); + this.withReason(instance.getReason()); + this.withStatus(instance.getStatus()); + this.withType(instance.getType()); + } + } + + public OffsetDateTime getLastUpdateTime() { + return this.lastUpdateTime; + } + + public A withLastUpdateTime(OffsetDateTime lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + return (A) this; + } + + public boolean hasLastUpdateTime() { + return this.lastUpdateTime != null; + } + + public String getMessage() { + return this.message; + } + + public A withMessage(String message) { + this.message = message; + return (A) this; + } + + public boolean hasMessage() { + return this.message != null; + } + + public String getReason() { + return this.reason; + } + + public A withReason(String reason) { + this.reason = reason; + return (A) this; + } + + public boolean hasReason() { + return this.reason != null; + } + + public String getStatus() { + return this.status; + } + + public A withStatus(String status) { + this.status = status; + return (A) this; + } + + public boolean hasStatus() { + return this.status != null; + } + + public String getType() { + return this.type; + } + + public A withType(String type) { + this.type = type; + return (A) this; + } + + public boolean hasType() { + return this.type != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1MigrationConditionFluent that = (V1alpha1MigrationConditionFluent) o; + if (!(Objects.equals(lastUpdateTime, that.lastUpdateTime))) { + return false; + } + if (!(Objects.equals(message, that.message))) { + return false; + } + if (!(Objects.equals(reason, that.reason))) { + return false; + } + if (!(Objects.equals(status, that.status))) { + return false; + } + if (!(Objects.equals(type, that.type))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(lastUpdateTime, message, reason, status, type); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(lastUpdateTime == null)) { + sb.append("lastUpdateTime:"); + sb.append(lastUpdateTime); + sb.append(","); + } + if (!(message == null)) { + sb.append("message:"); + sb.append(message); + sb.append(","); + } + if (!(reason == null)) { + sb.append("reason:"); + sb.append(reason); + sb.append(","); + } + if (!(status == null)) { + sb.append("status:"); + sb.append(status); + sb.append(","); + } + if (!(type == null)) { + sb.append("type:"); + sb.append(type); + } + sb.append("}"); + return sb.toString(); + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java new file mode 100644 index 0000000000..b6b4d0cd79 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java @@ -0,0 +1,36 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1PodCertificateRequestBuilder extends V1alpha1PodCertificateRequestFluent implements VisitableBuilder{ + public V1alpha1PodCertificateRequestBuilder() { + this(new V1alpha1PodCertificateRequest()); + } + + public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequestFluent fluent) { + this(fluent, new V1alpha1PodCertificateRequest()); + } + + public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequestFluent fluent,V1alpha1PodCertificateRequest instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequest instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1PodCertificateRequestFluent fluent; + + public V1alpha1PodCertificateRequest build() { + V1alpha1PodCertificateRequest buildable = new V1alpha1PodCertificateRequest(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + buildable.setSpec(fluent.buildSpec()); + buildable.setStatus(fluent.buildStatus()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java new file mode 100644 index 0000000000..7b1a6acb3b --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java @@ -0,0 +1,298 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.lang.String; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Optional; +import java.util.Objects; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1PodCertificateRequestFluent> extends BaseFluent{ + public V1alpha1PodCertificateRequestFluent() { + } + + public V1alpha1PodCertificateRequestFluent(V1alpha1PodCertificateRequest instance) { + this.copyInstance(instance); + } + private String apiVersion; + private String kind; + private V1ObjectMetaBuilder metadata; + private V1alpha1PodCertificateRequestSpecBuilder spec; + private V1alpha1PodCertificateRequestStatusBuilder status; + + protected void copyInstance(V1alpha1PodCertificateRequest instance) { + instance = instance != null ? instance : new V1alpha1PodCertificateRequest(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + this.withSpec(instance.getSpec()); + this.withStatus(instance.getStatus()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ObjectMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ObjectMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ObjectMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ObjectMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public V1alpha1PodCertificateRequestSpec buildSpec() { + return this.spec != null ? this.spec.build() : null; + } + + public A withSpec(V1alpha1PodCertificateRequestSpec spec) { + this._visitables.remove("spec"); + if (spec != null) { + this.spec = new V1alpha1PodCertificateRequestSpecBuilder(spec); + this._visitables.get("spec").add(this.spec); + } else { + this.spec = null; + this._visitables.get("spec").remove(this.spec); + } + return (A) this; + } + + public boolean hasSpec() { + return this.spec != null; + } + + public SpecNested withNewSpec() { + return new SpecNested(null); + } + + public SpecNested withNewSpecLike(V1alpha1PodCertificateRequestSpec item) { + return new SpecNested(item); + } + + public SpecNested editSpec() { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(null)); + } + + public SpecNested editOrNewSpec() { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(new V1alpha1PodCertificateRequestSpecBuilder().build())); + } + + public SpecNested editOrNewSpecLike(V1alpha1PodCertificateRequestSpec item) { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(item)); + } + + public V1alpha1PodCertificateRequestStatus buildStatus() { + return this.status != null ? this.status.build() : null; + } + + public A withStatus(V1alpha1PodCertificateRequestStatus status) { + this._visitables.remove("status"); + if (status != null) { + this.status = new V1alpha1PodCertificateRequestStatusBuilder(status); + this._visitables.get("status").add(this.status); + } else { + this.status = null; + this._visitables.get("status").remove(this.status); + } + return (A) this; + } + + public boolean hasStatus() { + return this.status != null; + } + + public StatusNested withNewStatus() { + return new StatusNested(null); + } + + public StatusNested withNewStatusLike(V1alpha1PodCertificateRequestStatus item) { + return new StatusNested(item); + } + + public StatusNested editStatus() { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(null)); + } + + public StatusNested editOrNewStatus() { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(new V1alpha1PodCertificateRequestStatusBuilder().build())); + } + + public StatusNested editOrNewStatusLike(V1alpha1PodCertificateRequestStatus item) { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1PodCertificateRequestFluent that = (V1alpha1PodCertificateRequestFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + if (!(Objects.equals(spec, that.spec))) { + return false; + } + if (!(Objects.equals(status, that.status))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + sb.append(","); + } + if (!(spec == null)) { + sb.append("spec:"); + sb.append(spec); + sb.append(","); + } + if (!(status == null)) { + sb.append("status:"); + sb.append(status); + } + sb.append("}"); + return sb.toString(); + } + public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ + MetadataNested(V1ObjectMeta item) { + this.builder = new V1ObjectMetaBuilder(this, item); + } + V1ObjectMetaBuilder builder; + + public N and() { + return (N) V1alpha1PodCertificateRequestFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + public class SpecNested extends V1alpha1PodCertificateRequestSpecFluent> implements Nested{ + SpecNested(V1alpha1PodCertificateRequestSpec item) { + this.builder = new V1alpha1PodCertificateRequestSpecBuilder(this, item); + } + V1alpha1PodCertificateRequestSpecBuilder builder; + + public N and() { + return (N) V1alpha1PodCertificateRequestFluent.this.withSpec(builder.build()); + } + + public N endSpec() { + return and(); + } + + + } + public class StatusNested extends V1alpha1PodCertificateRequestStatusFluent> implements Nested{ + StatusNested(V1alpha1PodCertificateRequestStatus item) { + this.builder = new V1alpha1PodCertificateRequestStatusBuilder(this, item); + } + V1alpha1PodCertificateRequestStatusBuilder builder; + + public N and() { + return (N) V1alpha1PodCertificateRequestFluent.this.withStatus(builder.build()); + } + + public N endStatus() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java new file mode 100644 index 0000000000..aeaa911eff --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java @@ -0,0 +1,35 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1PodCertificateRequestListBuilder extends V1alpha1PodCertificateRequestListFluent implements VisitableBuilder{ + public V1alpha1PodCertificateRequestListBuilder() { + this(new V1alpha1PodCertificateRequestList()); + } + + public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestListFluent fluent) { + this(fluent, new V1alpha1PodCertificateRequestList()); + } + + public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestListFluent fluent,V1alpha1PodCertificateRequestList instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestList instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1PodCertificateRequestListFluent fluent; + + public V1alpha1PodCertificateRequestList build() { + V1alpha1PodCertificateRequestList buildable = new V1alpha1PodCertificateRequestList(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setItems(fluent.buildItems()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java new file mode 100644 index 0000000000..06a25ab817 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java @@ -0,0 +1,408 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.util.ArrayList; +import java.lang.String; +import java.util.function.Predicate; +import java.lang.RuntimeException; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1PodCertificateRequestListFluent> extends BaseFluent{ + public V1alpha1PodCertificateRequestListFluent() { + } + + public V1alpha1PodCertificateRequestListFluent(V1alpha1PodCertificateRequestList instance) { + this.copyInstance(instance); + } + private String apiVersion; + private ArrayList items; + private String kind; + private V1ListMetaBuilder metadata; + + protected void copyInstance(V1alpha1PodCertificateRequestList instance) { + instance = instance != null ? instance : new V1alpha1PodCertificateRequestList(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withItems(instance.getItems()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public A addToItems(int index,V1alpha1PodCertificateRequest item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.add(index, builder); + } + return (A) this; + } + + public A setToItems(int index,V1alpha1PodCertificateRequest item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.set(index, builder); + } + return (A) this; + } + + public A addToItems(V1alpha1PodCertificateRequest... items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1PodCertificateRequest item : items) { + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A addAllToItems(Collection items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1PodCertificateRequest item : items) { + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A removeFromItems(V1alpha1PodCertificateRequest... items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1PodCertificateRequest item : items) { + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeAllFromItems(Collection items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1PodCertificateRequest item : items) { + V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeMatchingFromItems(Predicate predicate) { + if (items == null) { + return (A) this; + } + Iterator each = items.iterator(); + List visitables = _visitables.get("items"); + while (each.hasNext()) { + V1alpha1PodCertificateRequestBuilder builder = each.next(); + if (predicate.test(builder)) { + visitables.remove(builder); + each.remove(); + } + } + return (A) this; + } + + public List buildItems() { + return this.items != null ? build(items) : null; + } + + public V1alpha1PodCertificateRequest buildItem(int index) { + return this.items.get(index).build(); + } + + public V1alpha1PodCertificateRequest buildFirstItem() { + return this.items.get(0).build(); + } + + public V1alpha1PodCertificateRequest buildLastItem() { + return this.items.get(items.size() - 1).build(); + } + + public V1alpha1PodCertificateRequest buildMatchingItem(Predicate predicate) { + for (V1alpha1PodCertificateRequestBuilder item : items) { + if (predicate.test(item)) { + return item.build(); + } + } + return null; + } + + public boolean hasMatchingItem(Predicate predicate) { + for (V1alpha1PodCertificateRequestBuilder item : items) { + if (predicate.test(item)) { + return true; + } + } + return false; + } + + public A withItems(List items) { + if (this.items != null) { + this._visitables.get("items").clear(); + } + if (items != null) { + this.items = new ArrayList(); + for (V1alpha1PodCertificateRequest item : items) { + this.addToItems(item); + } + } else { + this.items = null; + } + return (A) this; + } + + public A withItems(V1alpha1PodCertificateRequest... items) { + if (this.items != null) { + this.items.clear(); + _visitables.remove("items"); + } + if (items != null) { + for (V1alpha1PodCertificateRequest item : items) { + this.addToItems(item); + } + } + return (A) this; + } + + public boolean hasItems() { + return this.items != null && !(this.items.isEmpty()); + } + + public ItemsNested addNewItem() { + return new ItemsNested(-1, null); + } + + public ItemsNested addNewItemLike(V1alpha1PodCertificateRequest item) { + return new ItemsNested(-1, item); + } + + public ItemsNested setNewItemLike(int index,V1alpha1PodCertificateRequest item) { + return new ItemsNested(index, item); + } + + public ItemsNested editItem(int index) { + if (index <= items.size()) { + throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editFirstItem() { + if (items.size() == 0) { + throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); + } + return this.setNewItemLike(0, this.buildItem(0)); + } + + public ItemsNested editLastItem() { + int index = items.size() - 1; + if (index < 0) { + throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editMatchingItem(Predicate predicate) { + int index = -1; + for (int i = 0;i < items.size();i++) { + if (predicate.test(items.get(i))) { + index = i; + break; + } + } + if (index < 0) { + throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ListMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ListMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ListMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ListMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ListMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1PodCertificateRequestListFluent that = (V1alpha1PodCertificateRequestListFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(items, that.items))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(items == null) && !(items.isEmpty())) { + sb.append("items:"); + sb.append(items); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + } + sb.append("}"); + return sb.toString(); + } + public class ItemsNested extends V1alpha1PodCertificateRequestFluent> implements Nested{ + ItemsNested(int index,V1alpha1PodCertificateRequest item) { + this.index = index; + this.builder = new V1alpha1PodCertificateRequestBuilder(this, item); + } + V1alpha1PodCertificateRequestBuilder builder; + int index; + + public N and() { + return (N) V1alpha1PodCertificateRequestListFluent.this.setToItems(index, builder.build()); + } + + public N endItem() { + return and(); + } + + + } + public class MetadataNested extends V1ListMetaFluent> implements Nested{ + MetadataNested(V1ListMeta item) { + this.builder = new V1ListMetaBuilder(this, item); + } + V1ListMetaBuilder builder; + + public N and() { + return (N) V1alpha1PodCertificateRequestListFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java new file mode 100644 index 0000000000..80ad69b1cd --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java @@ -0,0 +1,41 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1PodCertificateRequestSpecBuilder extends V1alpha1PodCertificateRequestSpecFluent implements VisitableBuilder{ + public V1alpha1PodCertificateRequestSpecBuilder() { + this(new V1alpha1PodCertificateRequestSpec()); + } + + public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpecFluent fluent) { + this(fluent, new V1alpha1PodCertificateRequestSpec()); + } + + public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpecFluent fluent,V1alpha1PodCertificateRequestSpec instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpec instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1PodCertificateRequestSpecFluent fluent; + + public V1alpha1PodCertificateRequestSpec build() { + V1alpha1PodCertificateRequestSpec buildable = new V1alpha1PodCertificateRequestSpec(); + buildable.setMaxExpirationSeconds(fluent.getMaxExpirationSeconds()); + buildable.setNodeName(fluent.getNodeName()); + buildable.setNodeUID(fluent.getNodeUID()); + buildable.setPkixPublicKey(fluent.getPkixPublicKey()); + buildable.setPodName(fluent.getPodName()); + buildable.setPodUID(fluent.getPodUID()); + buildable.setProofOfPossession(fluent.getProofOfPossession()); + buildable.setServiceAccountName(fluent.getServiceAccountName()); + buildable.setServiceAccountUID(fluent.getServiceAccountUID()); + buildable.setSignerName(fluent.getSignerName()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java new file mode 100644 index 0000000000..62ec63bdd4 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java @@ -0,0 +1,434 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import java.util.ArrayList; +import java.lang.String; +import java.lang.Integer; +import java.lang.Byte; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; +import java.util.List; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1PodCertificateRequestSpecFluent> extends BaseFluent{ + public V1alpha1PodCertificateRequestSpecFluent() { + } + + public V1alpha1PodCertificateRequestSpecFluent(V1alpha1PodCertificateRequestSpec instance) { + this.copyInstance(instance); + } + private Integer maxExpirationSeconds; + private String nodeName; + private String nodeUID; + private List pkixPublicKey; + private String podName; + private String podUID; + private List proofOfPossession; + private String serviceAccountName; + private String serviceAccountUID; + private String signerName; + + protected void copyInstance(V1alpha1PodCertificateRequestSpec instance) { + instance = instance != null ? instance : new V1alpha1PodCertificateRequestSpec(); + if (instance != null) { + this.withMaxExpirationSeconds(instance.getMaxExpirationSeconds()); + this.withNodeName(instance.getNodeName()); + this.withNodeUID(instance.getNodeUID()); + this.withPkixPublicKey(instance.getPkixPublicKey()); + this.withPodName(instance.getPodName()); + this.withPodUID(instance.getPodUID()); + this.withProofOfPossession(instance.getProofOfPossession()); + this.withServiceAccountName(instance.getServiceAccountName()); + this.withServiceAccountUID(instance.getServiceAccountUID()); + this.withSignerName(instance.getSignerName()); + } + } + + public Integer getMaxExpirationSeconds() { + return this.maxExpirationSeconds; + } + + public A withMaxExpirationSeconds(Integer maxExpirationSeconds) { + this.maxExpirationSeconds = maxExpirationSeconds; + return (A) this; + } + + public boolean hasMaxExpirationSeconds() { + return this.maxExpirationSeconds != null; + } + + public String getNodeName() { + return this.nodeName; + } + + public A withNodeName(String nodeName) { + this.nodeName = nodeName; + return (A) this; + } + + public boolean hasNodeName() { + return this.nodeName != null; + } + + public String getNodeUID() { + return this.nodeUID; + } + + public A withNodeUID(String nodeUID) { + this.nodeUID = nodeUID; + return (A) this; + } + + public boolean hasNodeUID() { + return this.nodeUID != null; + } + + public A withPkixPublicKey(byte... pkixPublicKey) { + if (this.pkixPublicKey != null) { + this.pkixPublicKey.clear(); + _visitables.remove("pkixPublicKey"); + } + if (pkixPublicKey != null) { + for (byte item : pkixPublicKey) { + this.addToPkixPublicKey(item); + } + } + return (A) this; + } + + public byte[] getPkixPublicKey() { + int size = pkixPublicKey != null ? pkixPublicKey.size() : 0; + byte[] result = new byte[size]; + if (size == 0) { + return result; + } + int index = 0; + for (byte item : pkixPublicKey) { + result[index++] = item; + } + return result; + } + + public A addToPkixPublicKey(int index,Byte item) { + if (this.pkixPublicKey == null) { + this.pkixPublicKey = new ArrayList(); + } + this.pkixPublicKey.add(index, item); + return (A) this; + } + + public A setToPkixPublicKey(int index,Byte item) { + if (this.pkixPublicKey == null) { + this.pkixPublicKey = new ArrayList(); + } + this.pkixPublicKey.set(index, item); + return (A) this; + } + + public A addToPkixPublicKey(Byte... items) { + if (this.pkixPublicKey == null) { + this.pkixPublicKey = new ArrayList(); + } + for (Byte item : items) { + this.pkixPublicKey.add(item); + } + return (A) this; + } + + public A addAllToPkixPublicKey(Collection items) { + if (this.pkixPublicKey == null) { + this.pkixPublicKey = new ArrayList(); + } + for (Byte item : items) { + this.pkixPublicKey.add(item); + } + return (A) this; + } + + public A removeFromPkixPublicKey(Byte... items) { + if (this.pkixPublicKey == null) { + return (A) this; + } + for (Byte item : items) { + this.pkixPublicKey.remove(item); + } + return (A) this; + } + + public A removeAllFromPkixPublicKey(Collection items) { + if (this.pkixPublicKey == null) { + return (A) this; + } + for (Byte item : items) { + this.pkixPublicKey.remove(item); + } + return (A) this; + } + + public boolean hasPkixPublicKey() { + return this.pkixPublicKey != null && !(this.pkixPublicKey.isEmpty()); + } + + public String getPodName() { + return this.podName; + } + + public A withPodName(String podName) { + this.podName = podName; + return (A) this; + } + + public boolean hasPodName() { + return this.podName != null; + } + + public String getPodUID() { + return this.podUID; + } + + public A withPodUID(String podUID) { + this.podUID = podUID; + return (A) this; + } + + public boolean hasPodUID() { + return this.podUID != null; + } + + public A withProofOfPossession(byte... proofOfPossession) { + if (this.proofOfPossession != null) { + this.proofOfPossession.clear(); + _visitables.remove("proofOfPossession"); + } + if (proofOfPossession != null) { + for (byte item : proofOfPossession) { + this.addToProofOfPossession(item); + } + } + return (A) this; + } + + public byte[] getProofOfPossession() { + int size = proofOfPossession != null ? proofOfPossession.size() : 0; + byte[] result = new byte[size]; + if (size == 0) { + return result; + } + int index = 0; + for (byte item : proofOfPossession) { + result[index++] = item; + } + return result; + } + + public A addToProofOfPossession(int index,Byte item) { + if (this.proofOfPossession == null) { + this.proofOfPossession = new ArrayList(); + } + this.proofOfPossession.add(index, item); + return (A) this; + } + + public A setToProofOfPossession(int index,Byte item) { + if (this.proofOfPossession == null) { + this.proofOfPossession = new ArrayList(); + } + this.proofOfPossession.set(index, item); + return (A) this; + } + + public A addToProofOfPossession(Byte... items) { + if (this.proofOfPossession == null) { + this.proofOfPossession = new ArrayList(); + } + for (Byte item : items) { + this.proofOfPossession.add(item); + } + return (A) this; + } + + public A addAllToProofOfPossession(Collection items) { + if (this.proofOfPossession == null) { + this.proofOfPossession = new ArrayList(); + } + for (Byte item : items) { + this.proofOfPossession.add(item); + } + return (A) this; + } + + public A removeFromProofOfPossession(Byte... items) { + if (this.proofOfPossession == null) { + return (A) this; + } + for (Byte item : items) { + this.proofOfPossession.remove(item); + } + return (A) this; + } + + public A removeAllFromProofOfPossession(Collection items) { + if (this.proofOfPossession == null) { + return (A) this; + } + for (Byte item : items) { + this.proofOfPossession.remove(item); + } + return (A) this; + } + + public boolean hasProofOfPossession() { + return this.proofOfPossession != null && !(this.proofOfPossession.isEmpty()); + } + + public String getServiceAccountName() { + return this.serviceAccountName; + } + + public A withServiceAccountName(String serviceAccountName) { + this.serviceAccountName = serviceAccountName; + return (A) this; + } + + public boolean hasServiceAccountName() { + return this.serviceAccountName != null; + } + + public String getServiceAccountUID() { + return this.serviceAccountUID; + } + + public A withServiceAccountUID(String serviceAccountUID) { + this.serviceAccountUID = serviceAccountUID; + return (A) this; + } + + public boolean hasServiceAccountUID() { + return this.serviceAccountUID != null; + } + + public String getSignerName() { + return this.signerName; + } + + public A withSignerName(String signerName) { + this.signerName = signerName; + return (A) this; + } + + public boolean hasSignerName() { + return this.signerName != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1PodCertificateRequestSpecFluent that = (V1alpha1PodCertificateRequestSpecFluent) o; + if (!(Objects.equals(maxExpirationSeconds, that.maxExpirationSeconds))) { + return false; + } + if (!(Objects.equals(nodeName, that.nodeName))) { + return false; + } + if (!(Objects.equals(nodeUID, that.nodeUID))) { + return false; + } + if (!(Objects.equals(pkixPublicKey, that.pkixPublicKey))) { + return false; + } + if (!(Objects.equals(podName, that.podName))) { + return false; + } + if (!(Objects.equals(podUID, that.podUID))) { + return false; + } + if (!(Objects.equals(proofOfPossession, that.proofOfPossession))) { + return false; + } + if (!(Objects.equals(serviceAccountName, that.serviceAccountName))) { + return false; + } + if (!(Objects.equals(serviceAccountUID, that.serviceAccountUID))) { + return false; + } + if (!(Objects.equals(signerName, that.signerName))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(maxExpirationSeconds, nodeName, nodeUID, pkixPublicKey, podName, podUID, proofOfPossession, serviceAccountName, serviceAccountUID, signerName); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(maxExpirationSeconds == null)) { + sb.append("maxExpirationSeconds:"); + sb.append(maxExpirationSeconds); + sb.append(","); + } + if (!(nodeName == null)) { + sb.append("nodeName:"); + sb.append(nodeName); + sb.append(","); + } + if (!(nodeUID == null)) { + sb.append("nodeUID:"); + sb.append(nodeUID); + sb.append(","); + } + if (!(pkixPublicKey == null) && !(pkixPublicKey.isEmpty())) { + sb.append("pkixPublicKey:"); + sb.append(pkixPublicKey); + sb.append(","); + } + if (!(podName == null)) { + sb.append("podName:"); + sb.append(podName); + sb.append(","); + } + if (!(podUID == null)) { + sb.append("podUID:"); + sb.append(podUID); + sb.append(","); + } + if (!(proofOfPossession == null) && !(proofOfPossession.isEmpty())) { + sb.append("proofOfPossession:"); + sb.append(proofOfPossession); + sb.append(","); + } + if (!(serviceAccountName == null)) { + sb.append("serviceAccountName:"); + sb.append(serviceAccountName); + sb.append(","); + } + if (!(serviceAccountUID == null)) { + sb.append("serviceAccountUID:"); + sb.append(serviceAccountUID); + sb.append(","); + } + if (!(signerName == null)) { + sb.append("signerName:"); + sb.append(signerName); + } + sb.append("}"); + return sb.toString(); + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java new file mode 100644 index 0000000000..39668a7078 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java @@ -0,0 +1,36 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1PodCertificateRequestStatusBuilder extends V1alpha1PodCertificateRequestStatusFluent implements VisitableBuilder{ + public V1alpha1PodCertificateRequestStatusBuilder() { + this(new V1alpha1PodCertificateRequestStatus()); + } + + public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatusFluent fluent) { + this(fluent, new V1alpha1PodCertificateRequestStatus()); + } + + public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatusFluent fluent,V1alpha1PodCertificateRequestStatus instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatus instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1PodCertificateRequestStatusFluent fluent; + + public V1alpha1PodCertificateRequestStatus build() { + V1alpha1PodCertificateRequestStatus buildable = new V1alpha1PodCertificateRequestStatus(); + buildable.setBeginRefreshAt(fluent.getBeginRefreshAt()); + buildable.setCertificateChain(fluent.getCertificateChain()); + buildable.setConditions(fluent.buildConditions()); + buildable.setNotAfter(fluent.getNotAfter()); + buildable.setNotBefore(fluent.getNotBefore()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java new file mode 100644 index 0000000000..2dc94e78f8 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java @@ -0,0 +1,388 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.util.ArrayList; +import java.lang.String; +import java.util.function.Predicate; +import java.lang.RuntimeException; +import java.time.OffsetDateTime; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Iterator; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; +import java.util.List; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1PodCertificateRequestStatusFluent> extends BaseFluent{ + public V1alpha1PodCertificateRequestStatusFluent() { + } + + public V1alpha1PodCertificateRequestStatusFluent(V1alpha1PodCertificateRequestStatus instance) { + this.copyInstance(instance); + } + private OffsetDateTime beginRefreshAt; + private String certificateChain; + private ArrayList conditions; + private OffsetDateTime notAfter; + private OffsetDateTime notBefore; + + protected void copyInstance(V1alpha1PodCertificateRequestStatus instance) { + instance = instance != null ? instance : new V1alpha1PodCertificateRequestStatus(); + if (instance != null) { + this.withBeginRefreshAt(instance.getBeginRefreshAt()); + this.withCertificateChain(instance.getCertificateChain()); + this.withConditions(instance.getConditions()); + this.withNotAfter(instance.getNotAfter()); + this.withNotBefore(instance.getNotBefore()); + } + } + + public OffsetDateTime getBeginRefreshAt() { + return this.beginRefreshAt; + } + + public A withBeginRefreshAt(OffsetDateTime beginRefreshAt) { + this.beginRefreshAt = beginRefreshAt; + return (A) this; + } + + public boolean hasBeginRefreshAt() { + return this.beginRefreshAt != null; + } + + public String getCertificateChain() { + return this.certificateChain; + } + + public A withCertificateChain(String certificateChain) { + this.certificateChain = certificateChain; + return (A) this; + } + + public boolean hasCertificateChain() { + return this.certificateChain != null; + } + + public A addToConditions(int index,V1Condition item) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + V1ConditionBuilder builder = new V1ConditionBuilder(item); + if (index < 0 || index >= conditions.size()) { + _visitables.get("conditions").add(builder); + conditions.add(builder); + } else { + _visitables.get("conditions").add(builder); + conditions.add(index, builder); + } + return (A) this; + } + + public A setToConditions(int index,V1Condition item) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + V1ConditionBuilder builder = new V1ConditionBuilder(item); + if (index < 0 || index >= conditions.size()) { + _visitables.get("conditions").add(builder); + conditions.add(builder); + } else { + _visitables.get("conditions").add(builder); + conditions.set(index, builder); + } + return (A) this; + } + + public A addToConditions(V1Condition... items) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + for (V1Condition item : items) { + V1ConditionBuilder builder = new V1ConditionBuilder(item); + _visitables.get("conditions").add(builder); + this.conditions.add(builder); + } + return (A) this; + } + + public A addAllToConditions(Collection items) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + for (V1Condition item : items) { + V1ConditionBuilder builder = new V1ConditionBuilder(item); + _visitables.get("conditions").add(builder); + this.conditions.add(builder); + } + return (A) this; + } + + public A removeFromConditions(V1Condition... items) { + if (this.conditions == null) { + return (A) this; + } + for (V1Condition item : items) { + V1ConditionBuilder builder = new V1ConditionBuilder(item); + _visitables.get("conditions").remove(builder); + this.conditions.remove(builder); + } + return (A) this; + } + + public A removeAllFromConditions(Collection items) { + if (this.conditions == null) { + return (A) this; + } + for (V1Condition item : items) { + V1ConditionBuilder builder = new V1ConditionBuilder(item); + _visitables.get("conditions").remove(builder); + this.conditions.remove(builder); + } + return (A) this; + } + + public A removeMatchingFromConditions(Predicate predicate) { + if (conditions == null) { + return (A) this; + } + Iterator each = conditions.iterator(); + List visitables = _visitables.get("conditions"); + while (each.hasNext()) { + V1ConditionBuilder builder = each.next(); + if (predicate.test(builder)) { + visitables.remove(builder); + each.remove(); + } + } + return (A) this; + } + + public List buildConditions() { + return this.conditions != null ? build(conditions) : null; + } + + public V1Condition buildCondition(int index) { + return this.conditions.get(index).build(); + } + + public V1Condition buildFirstCondition() { + return this.conditions.get(0).build(); + } + + public V1Condition buildLastCondition() { + return this.conditions.get(conditions.size() - 1).build(); + } + + public V1Condition buildMatchingCondition(Predicate predicate) { + for (V1ConditionBuilder item : conditions) { + if (predicate.test(item)) { + return item.build(); + } + } + return null; + } + + public boolean hasMatchingCondition(Predicate predicate) { + for (V1ConditionBuilder item : conditions) { + if (predicate.test(item)) { + return true; + } + } + return false; + } + + public A withConditions(List conditions) { + if (this.conditions != null) { + this._visitables.get("conditions").clear(); + } + if (conditions != null) { + this.conditions = new ArrayList(); + for (V1Condition item : conditions) { + this.addToConditions(item); + } + } else { + this.conditions = null; + } + return (A) this; + } + + public A withConditions(V1Condition... conditions) { + if (this.conditions != null) { + this.conditions.clear(); + _visitables.remove("conditions"); + } + if (conditions != null) { + for (V1Condition item : conditions) { + this.addToConditions(item); + } + } + return (A) this; + } + + public boolean hasConditions() { + return this.conditions != null && !(this.conditions.isEmpty()); + } + + public ConditionsNested addNewCondition() { + return new ConditionsNested(-1, null); + } + + public ConditionsNested addNewConditionLike(V1Condition item) { + return new ConditionsNested(-1, item); + } + + public ConditionsNested setNewConditionLike(int index,V1Condition item) { + return new ConditionsNested(index, item); + } + + public ConditionsNested editCondition(int index) { + if (index <= conditions.size()) { + throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public ConditionsNested editFirstCondition() { + if (conditions.size() == 0) { + throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "conditions")); + } + return this.setNewConditionLike(0, this.buildCondition(0)); + } + + public ConditionsNested editLastCondition() { + int index = conditions.size() - 1; + if (index < 0) { + throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public ConditionsNested editMatchingCondition(Predicate predicate) { + int index = -1; + for (int i = 0;i < conditions.size();i++) { + if (predicate.test(conditions.get(i))) { + index = i; + break; + } + } + if (index < 0) { + throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public OffsetDateTime getNotAfter() { + return this.notAfter; + } + + public A withNotAfter(OffsetDateTime notAfter) { + this.notAfter = notAfter; + return (A) this; + } + + public boolean hasNotAfter() { + return this.notAfter != null; + } + + public OffsetDateTime getNotBefore() { + return this.notBefore; + } + + public A withNotBefore(OffsetDateTime notBefore) { + this.notBefore = notBefore; + return (A) this; + } + + public boolean hasNotBefore() { + return this.notBefore != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1PodCertificateRequestStatusFluent that = (V1alpha1PodCertificateRequestStatusFluent) o; + if (!(Objects.equals(beginRefreshAt, that.beginRefreshAt))) { + return false; + } + if (!(Objects.equals(certificateChain, that.certificateChain))) { + return false; + } + if (!(Objects.equals(conditions, that.conditions))) { + return false; + } + if (!(Objects.equals(notAfter, that.notAfter))) { + return false; + } + if (!(Objects.equals(notBefore, that.notBefore))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(beginRefreshAt, certificateChain, conditions, notAfter, notBefore); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(beginRefreshAt == null)) { + sb.append("beginRefreshAt:"); + sb.append(beginRefreshAt); + sb.append(","); + } + if (!(certificateChain == null)) { + sb.append("certificateChain:"); + sb.append(certificateChain); + sb.append(","); + } + if (!(conditions == null) && !(conditions.isEmpty())) { + sb.append("conditions:"); + sb.append(conditions); + sb.append(","); + } + if (!(notAfter == null)) { + sb.append("notAfter:"); + sb.append(notAfter); + sb.append(","); + } + if (!(notBefore == null)) { + sb.append("notBefore:"); + sb.append(notBefore); + } + sb.append("}"); + return sb.toString(); + } + public class ConditionsNested extends V1ConditionFluent> implements Nested{ + ConditionsNested(int index,V1Condition item) { + this.index = index; + this.builder = new V1ConditionBuilder(this, item); + } + V1ConditionBuilder builder; + int index; + + public N and() { + return (N) V1alpha1PodCertificateRequestStatusFluent.this.setToConditions(index, builder.build()); + } + + public N endCondition() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java new file mode 100644 index 0000000000..26c0cc4378 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java @@ -0,0 +1,36 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1StorageVersionMigrationBuilder extends V1alpha1StorageVersionMigrationFluent implements VisitableBuilder{ + public V1alpha1StorageVersionMigrationBuilder() { + this(new V1alpha1StorageVersionMigration()); + } + + public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigrationFluent fluent) { + this(fluent, new V1alpha1StorageVersionMigration()); + } + + public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigrationFluent fluent,V1alpha1StorageVersionMigration instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigration instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1StorageVersionMigrationFluent fluent; + + public V1alpha1StorageVersionMigration build() { + V1alpha1StorageVersionMigration buildable = new V1alpha1StorageVersionMigration(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + buildable.setSpec(fluent.buildSpec()); + buildable.setStatus(fluent.buildStatus()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java new file mode 100644 index 0000000000..5d1d57cd22 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java @@ -0,0 +1,298 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.lang.String; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Optional; +import java.util.Objects; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1StorageVersionMigrationFluent> extends BaseFluent{ + public V1alpha1StorageVersionMigrationFluent() { + } + + public V1alpha1StorageVersionMigrationFluent(V1alpha1StorageVersionMigration instance) { + this.copyInstance(instance); + } + private String apiVersion; + private String kind; + private V1ObjectMetaBuilder metadata; + private V1alpha1StorageVersionMigrationSpecBuilder spec; + private V1alpha1StorageVersionMigrationStatusBuilder status; + + protected void copyInstance(V1alpha1StorageVersionMigration instance) { + instance = instance != null ? instance : new V1alpha1StorageVersionMigration(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + this.withSpec(instance.getSpec()); + this.withStatus(instance.getStatus()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ObjectMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ObjectMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ObjectMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ObjectMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public V1alpha1StorageVersionMigrationSpec buildSpec() { + return this.spec != null ? this.spec.build() : null; + } + + public A withSpec(V1alpha1StorageVersionMigrationSpec spec) { + this._visitables.remove("spec"); + if (spec != null) { + this.spec = new V1alpha1StorageVersionMigrationSpecBuilder(spec); + this._visitables.get("spec").add(this.spec); + } else { + this.spec = null; + this._visitables.get("spec").remove(this.spec); + } + return (A) this; + } + + public boolean hasSpec() { + return this.spec != null; + } + + public SpecNested withNewSpec() { + return new SpecNested(null); + } + + public SpecNested withNewSpecLike(V1alpha1StorageVersionMigrationSpec item) { + return new SpecNested(item); + } + + public SpecNested editSpec() { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(null)); + } + + public SpecNested editOrNewSpec() { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(new V1alpha1StorageVersionMigrationSpecBuilder().build())); + } + + public SpecNested editOrNewSpecLike(V1alpha1StorageVersionMigrationSpec item) { + return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(item)); + } + + public V1alpha1StorageVersionMigrationStatus buildStatus() { + return this.status != null ? this.status.build() : null; + } + + public A withStatus(V1alpha1StorageVersionMigrationStatus status) { + this._visitables.remove("status"); + if (status != null) { + this.status = new V1alpha1StorageVersionMigrationStatusBuilder(status); + this._visitables.get("status").add(this.status); + } else { + this.status = null; + this._visitables.get("status").remove(this.status); + } + return (A) this; + } + + public boolean hasStatus() { + return this.status != null; + } + + public StatusNested withNewStatus() { + return new StatusNested(null); + } + + public StatusNested withNewStatusLike(V1alpha1StorageVersionMigrationStatus item) { + return new StatusNested(item); + } + + public StatusNested editStatus() { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(null)); + } + + public StatusNested editOrNewStatus() { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(new V1alpha1StorageVersionMigrationStatusBuilder().build())); + } + + public StatusNested editOrNewStatusLike(V1alpha1StorageVersionMigrationStatus item) { + return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1StorageVersionMigrationFluent that = (V1alpha1StorageVersionMigrationFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + if (!(Objects.equals(spec, that.spec))) { + return false; + } + if (!(Objects.equals(status, that.status))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + sb.append(","); + } + if (!(spec == null)) { + sb.append("spec:"); + sb.append(spec); + sb.append(","); + } + if (!(status == null)) { + sb.append("status:"); + sb.append(status); + } + sb.append("}"); + return sb.toString(); + } + public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ + MetadataNested(V1ObjectMeta item) { + this.builder = new V1ObjectMetaBuilder(this, item); + } + V1ObjectMetaBuilder builder; + + public N and() { + return (N) V1alpha1StorageVersionMigrationFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + public class SpecNested extends V1alpha1StorageVersionMigrationSpecFluent> implements Nested{ + SpecNested(V1alpha1StorageVersionMigrationSpec item) { + this.builder = new V1alpha1StorageVersionMigrationSpecBuilder(this, item); + } + V1alpha1StorageVersionMigrationSpecBuilder builder; + + public N and() { + return (N) V1alpha1StorageVersionMigrationFluent.this.withSpec(builder.build()); + } + + public N endSpec() { + return and(); + } + + + } + public class StatusNested extends V1alpha1StorageVersionMigrationStatusFluent> implements Nested{ + StatusNested(V1alpha1StorageVersionMigrationStatus item) { + this.builder = new V1alpha1StorageVersionMigrationStatusBuilder(this, item); + } + V1alpha1StorageVersionMigrationStatusBuilder builder; + + public N and() { + return (N) V1alpha1StorageVersionMigrationFluent.this.withStatus(builder.build()); + } + + public N endStatus() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java new file mode 100644 index 0000000000..cd49a8f5c9 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java @@ -0,0 +1,35 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1StorageVersionMigrationListBuilder extends V1alpha1StorageVersionMigrationListFluent implements VisitableBuilder{ + public V1alpha1StorageVersionMigrationListBuilder() { + this(new V1alpha1StorageVersionMigrationList()); + } + + public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationListFluent fluent) { + this(fluent, new V1alpha1StorageVersionMigrationList()); + } + + public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationListFluent fluent,V1alpha1StorageVersionMigrationList instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationList instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1StorageVersionMigrationListFluent fluent; + + public V1alpha1StorageVersionMigrationList build() { + V1alpha1StorageVersionMigrationList buildable = new V1alpha1StorageVersionMigrationList(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setItems(fluent.buildItems()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java new file mode 100644 index 0000000000..98a7c18d38 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java @@ -0,0 +1,408 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.util.ArrayList; +import java.lang.String; +import java.util.function.Predicate; +import java.lang.RuntimeException; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1StorageVersionMigrationListFluent> extends BaseFluent{ + public V1alpha1StorageVersionMigrationListFluent() { + } + + public V1alpha1StorageVersionMigrationListFluent(V1alpha1StorageVersionMigrationList instance) { + this.copyInstance(instance); + } + private String apiVersion; + private ArrayList items; + private String kind; + private V1ListMetaBuilder metadata; + + protected void copyInstance(V1alpha1StorageVersionMigrationList instance) { + instance = instance != null ? instance : new V1alpha1StorageVersionMigrationList(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withItems(instance.getItems()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public A addToItems(int index,V1alpha1StorageVersionMigration item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.add(index, builder); + } + return (A) this; + } + + public A setToItems(int index,V1alpha1StorageVersionMigration item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.set(index, builder); + } + return (A) this; + } + + public A addToItems(V1alpha1StorageVersionMigration... items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1StorageVersionMigration item : items) { + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A addAllToItems(Collection items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1StorageVersionMigration item : items) { + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A removeFromItems(V1alpha1StorageVersionMigration... items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1StorageVersionMigration item : items) { + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeAllFromItems(Collection items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1StorageVersionMigration item : items) { + V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeMatchingFromItems(Predicate predicate) { + if (items == null) { + return (A) this; + } + Iterator each = items.iterator(); + List visitables = _visitables.get("items"); + while (each.hasNext()) { + V1alpha1StorageVersionMigrationBuilder builder = each.next(); + if (predicate.test(builder)) { + visitables.remove(builder); + each.remove(); + } + } + return (A) this; + } + + public List buildItems() { + return this.items != null ? build(items) : null; + } + + public V1alpha1StorageVersionMigration buildItem(int index) { + return this.items.get(index).build(); + } + + public V1alpha1StorageVersionMigration buildFirstItem() { + return this.items.get(0).build(); + } + + public V1alpha1StorageVersionMigration buildLastItem() { + return this.items.get(items.size() - 1).build(); + } + + public V1alpha1StorageVersionMigration buildMatchingItem(Predicate predicate) { + for (V1alpha1StorageVersionMigrationBuilder item : items) { + if (predicate.test(item)) { + return item.build(); + } + } + return null; + } + + public boolean hasMatchingItem(Predicate predicate) { + for (V1alpha1StorageVersionMigrationBuilder item : items) { + if (predicate.test(item)) { + return true; + } + } + return false; + } + + public A withItems(List items) { + if (this.items != null) { + this._visitables.get("items").clear(); + } + if (items != null) { + this.items = new ArrayList(); + for (V1alpha1StorageVersionMigration item : items) { + this.addToItems(item); + } + } else { + this.items = null; + } + return (A) this; + } + + public A withItems(V1alpha1StorageVersionMigration... items) { + if (this.items != null) { + this.items.clear(); + _visitables.remove("items"); + } + if (items != null) { + for (V1alpha1StorageVersionMigration item : items) { + this.addToItems(item); + } + } + return (A) this; + } + + public boolean hasItems() { + return this.items != null && !(this.items.isEmpty()); + } + + public ItemsNested addNewItem() { + return new ItemsNested(-1, null); + } + + public ItemsNested addNewItemLike(V1alpha1StorageVersionMigration item) { + return new ItemsNested(-1, item); + } + + public ItemsNested setNewItemLike(int index,V1alpha1StorageVersionMigration item) { + return new ItemsNested(index, item); + } + + public ItemsNested editItem(int index) { + if (index <= items.size()) { + throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editFirstItem() { + if (items.size() == 0) { + throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); + } + return this.setNewItemLike(0, this.buildItem(0)); + } + + public ItemsNested editLastItem() { + int index = items.size() - 1; + if (index < 0) { + throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editMatchingItem(Predicate predicate) { + int index = -1; + for (int i = 0;i < items.size();i++) { + if (predicate.test(items.get(i))) { + index = i; + break; + } + } + if (index < 0) { + throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ListMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ListMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ListMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ListMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ListMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1StorageVersionMigrationListFluent that = (V1alpha1StorageVersionMigrationListFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(items, that.items))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(items == null) && !(items.isEmpty())) { + sb.append("items:"); + sb.append(items); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + } + sb.append("}"); + return sb.toString(); + } + public class ItemsNested extends V1alpha1StorageVersionMigrationFluent> implements Nested{ + ItemsNested(int index,V1alpha1StorageVersionMigration item) { + this.index = index; + this.builder = new V1alpha1StorageVersionMigrationBuilder(this, item); + } + V1alpha1StorageVersionMigrationBuilder builder; + int index; + + public N and() { + return (N) V1alpha1StorageVersionMigrationListFluent.this.setToItems(index, builder.build()); + } + + public N endItem() { + return and(); + } + + + } + public class MetadataNested extends V1ListMetaFluent> implements Nested{ + MetadataNested(V1ListMeta item) { + this.builder = new V1ListMetaBuilder(this, item); + } + V1ListMetaBuilder builder; + + public N and() { + return (N) V1alpha1StorageVersionMigrationListFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java new file mode 100644 index 0000000000..6457c13388 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java @@ -0,0 +1,33 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1StorageVersionMigrationSpecBuilder extends V1alpha1StorageVersionMigrationSpecFluent implements VisitableBuilder{ + public V1alpha1StorageVersionMigrationSpecBuilder() { + this(new V1alpha1StorageVersionMigrationSpec()); + } + + public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpecFluent fluent) { + this(fluent, new V1alpha1StorageVersionMigrationSpec()); + } + + public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpecFluent fluent,V1alpha1StorageVersionMigrationSpec instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpec instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1StorageVersionMigrationSpecFluent fluent; + + public V1alpha1StorageVersionMigrationSpec build() { + V1alpha1StorageVersionMigrationSpec buildable = new V1alpha1StorageVersionMigrationSpec(); + buildable.setContinueToken(fluent.getContinueToken()); + buildable.setResource(fluent.buildResource()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java new file mode 100644 index 0000000000..8c1b2e9a10 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java @@ -0,0 +1,143 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.util.Optional; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.lang.String; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1StorageVersionMigrationSpecFluent> extends BaseFluent{ + public V1alpha1StorageVersionMigrationSpecFluent() { + } + + public V1alpha1StorageVersionMigrationSpecFluent(V1alpha1StorageVersionMigrationSpec instance) { + this.copyInstance(instance); + } + private String continueToken; + private V1alpha1GroupVersionResourceBuilder resource; + + protected void copyInstance(V1alpha1StorageVersionMigrationSpec instance) { + instance = instance != null ? instance : new V1alpha1StorageVersionMigrationSpec(); + if (instance != null) { + this.withContinueToken(instance.getContinueToken()); + this.withResource(instance.getResource()); + } + } + + public String getContinueToken() { + return this.continueToken; + } + + public A withContinueToken(String continueToken) { + this.continueToken = continueToken; + return (A) this; + } + + public boolean hasContinueToken() { + return this.continueToken != null; + } + + public V1alpha1GroupVersionResource buildResource() { + return this.resource != null ? this.resource.build() : null; + } + + public A withResource(V1alpha1GroupVersionResource resource) { + this._visitables.remove("resource"); + if (resource != null) { + this.resource = new V1alpha1GroupVersionResourceBuilder(resource); + this._visitables.get("resource").add(this.resource); + } else { + this.resource = null; + this._visitables.get("resource").remove(this.resource); + } + return (A) this; + } + + public boolean hasResource() { + return this.resource != null; + } + + public ResourceNested withNewResource() { + return new ResourceNested(null); + } + + public ResourceNested withNewResourceLike(V1alpha1GroupVersionResource item) { + return new ResourceNested(item); + } + + public ResourceNested editResource() { + return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(null)); + } + + public ResourceNested editOrNewResource() { + return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(new V1alpha1GroupVersionResourceBuilder().build())); + } + + public ResourceNested editOrNewResourceLike(V1alpha1GroupVersionResource item) { + return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1StorageVersionMigrationSpecFluent that = (V1alpha1StorageVersionMigrationSpecFluent) o; + if (!(Objects.equals(continueToken, that.continueToken))) { + return false; + } + if (!(Objects.equals(resource, that.resource))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(continueToken, resource); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(continueToken == null)) { + sb.append("continueToken:"); + sb.append(continueToken); + sb.append(","); + } + if (!(resource == null)) { + sb.append("resource:"); + sb.append(resource); + } + sb.append("}"); + return sb.toString(); + } + public class ResourceNested extends V1alpha1GroupVersionResourceFluent> implements Nested{ + ResourceNested(V1alpha1GroupVersionResource item) { + this.builder = new V1alpha1GroupVersionResourceBuilder(this, item); + } + V1alpha1GroupVersionResourceBuilder builder; + + public N and() { + return (N) V1alpha1StorageVersionMigrationSpecFluent.this.withResource(builder.build()); + } + + public N endResource() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java new file mode 100644 index 0000000000..82041b8ef8 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java @@ -0,0 +1,33 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1StorageVersionMigrationStatusBuilder extends V1alpha1StorageVersionMigrationStatusFluent implements VisitableBuilder{ + public V1alpha1StorageVersionMigrationStatusBuilder() { + this(new V1alpha1StorageVersionMigrationStatus()); + } + + public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatusFluent fluent) { + this(fluent, new V1alpha1StorageVersionMigrationStatus()); + } + + public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatusFluent fluent,V1alpha1StorageVersionMigrationStatus instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatus instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1StorageVersionMigrationStatusFluent fluent; + + public V1alpha1StorageVersionMigrationStatus build() { + V1alpha1StorageVersionMigrationStatus buildable = new V1alpha1StorageVersionMigrationStatus(); + buildable.setConditions(fluent.buildConditions()); + buildable.setResourceVersion(fluent.getResourceVersion()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java new file mode 100644 index 0000000000..71c112a813 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java @@ -0,0 +1,318 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.util.ArrayList; +import java.lang.String; +import java.util.function.Predicate; +import java.lang.RuntimeException; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Iterator; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; +import java.util.List; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1StorageVersionMigrationStatusFluent> extends BaseFluent{ + public V1alpha1StorageVersionMigrationStatusFluent() { + } + + public V1alpha1StorageVersionMigrationStatusFluent(V1alpha1StorageVersionMigrationStatus instance) { + this.copyInstance(instance); + } + private ArrayList conditions; + private String resourceVersion; + + protected void copyInstance(V1alpha1StorageVersionMigrationStatus instance) { + instance = instance != null ? instance : new V1alpha1StorageVersionMigrationStatus(); + if (instance != null) { + this.withConditions(instance.getConditions()); + this.withResourceVersion(instance.getResourceVersion()); + } + } + + public A addToConditions(int index,V1alpha1MigrationCondition item) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + if (index < 0 || index >= conditions.size()) { + _visitables.get("conditions").add(builder); + conditions.add(builder); + } else { + _visitables.get("conditions").add(builder); + conditions.add(index, builder); + } + return (A) this; + } + + public A setToConditions(int index,V1alpha1MigrationCondition item) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + if (index < 0 || index >= conditions.size()) { + _visitables.get("conditions").add(builder); + conditions.add(builder); + } else { + _visitables.get("conditions").add(builder); + conditions.set(index, builder); + } + return (A) this; + } + + public A addToConditions(V1alpha1MigrationCondition... items) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + for (V1alpha1MigrationCondition item : items) { + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + _visitables.get("conditions").add(builder); + this.conditions.add(builder); + } + return (A) this; + } + + public A addAllToConditions(Collection items) { + if (this.conditions == null) { + this.conditions = new ArrayList(); + } + for (V1alpha1MigrationCondition item : items) { + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + _visitables.get("conditions").add(builder); + this.conditions.add(builder); + } + return (A) this; + } + + public A removeFromConditions(V1alpha1MigrationCondition... items) { + if (this.conditions == null) { + return (A) this; + } + for (V1alpha1MigrationCondition item : items) { + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + _visitables.get("conditions").remove(builder); + this.conditions.remove(builder); + } + return (A) this; + } + + public A removeAllFromConditions(Collection items) { + if (this.conditions == null) { + return (A) this; + } + for (V1alpha1MigrationCondition item : items) { + V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); + _visitables.get("conditions").remove(builder); + this.conditions.remove(builder); + } + return (A) this; + } + + public A removeMatchingFromConditions(Predicate predicate) { + if (conditions == null) { + return (A) this; + } + Iterator each = conditions.iterator(); + List visitables = _visitables.get("conditions"); + while (each.hasNext()) { + V1alpha1MigrationConditionBuilder builder = each.next(); + if (predicate.test(builder)) { + visitables.remove(builder); + each.remove(); + } + } + return (A) this; + } + + public List buildConditions() { + return this.conditions != null ? build(conditions) : null; + } + + public V1alpha1MigrationCondition buildCondition(int index) { + return this.conditions.get(index).build(); + } + + public V1alpha1MigrationCondition buildFirstCondition() { + return this.conditions.get(0).build(); + } + + public V1alpha1MigrationCondition buildLastCondition() { + return this.conditions.get(conditions.size() - 1).build(); + } + + public V1alpha1MigrationCondition buildMatchingCondition(Predicate predicate) { + for (V1alpha1MigrationConditionBuilder item : conditions) { + if (predicate.test(item)) { + return item.build(); + } + } + return null; + } + + public boolean hasMatchingCondition(Predicate predicate) { + for (V1alpha1MigrationConditionBuilder item : conditions) { + if (predicate.test(item)) { + return true; + } + } + return false; + } + + public A withConditions(List conditions) { + if (this.conditions != null) { + this._visitables.get("conditions").clear(); + } + if (conditions != null) { + this.conditions = new ArrayList(); + for (V1alpha1MigrationCondition item : conditions) { + this.addToConditions(item); + } + } else { + this.conditions = null; + } + return (A) this; + } + + public A withConditions(V1alpha1MigrationCondition... conditions) { + if (this.conditions != null) { + this.conditions.clear(); + _visitables.remove("conditions"); + } + if (conditions != null) { + for (V1alpha1MigrationCondition item : conditions) { + this.addToConditions(item); + } + } + return (A) this; + } + + public boolean hasConditions() { + return this.conditions != null && !(this.conditions.isEmpty()); + } + + public ConditionsNested addNewCondition() { + return new ConditionsNested(-1, null); + } + + public ConditionsNested addNewConditionLike(V1alpha1MigrationCondition item) { + return new ConditionsNested(-1, item); + } + + public ConditionsNested setNewConditionLike(int index,V1alpha1MigrationCondition item) { + return new ConditionsNested(index, item); + } + + public ConditionsNested editCondition(int index) { + if (index <= conditions.size()) { + throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public ConditionsNested editFirstCondition() { + if (conditions.size() == 0) { + throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "conditions")); + } + return this.setNewConditionLike(0, this.buildCondition(0)); + } + + public ConditionsNested editLastCondition() { + int index = conditions.size() - 1; + if (index < 0) { + throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public ConditionsNested editMatchingCondition(Predicate predicate) { + int index = -1; + for (int i = 0;i < conditions.size();i++) { + if (predicate.test(conditions.get(i))) { + index = i; + break; + } + } + if (index < 0) { + throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "conditions")); + } + return this.setNewConditionLike(index, this.buildCondition(index)); + } + + public String getResourceVersion() { + return this.resourceVersion; + } + + public A withResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + return (A) this; + } + + public boolean hasResourceVersion() { + return this.resourceVersion != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1StorageVersionMigrationStatusFluent that = (V1alpha1StorageVersionMigrationStatusFluent) o; + if (!(Objects.equals(conditions, that.conditions))) { + return false; + } + if (!(Objects.equals(resourceVersion, that.resourceVersion))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(conditions, resourceVersion); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(conditions == null) && !(conditions.isEmpty())) { + sb.append("conditions:"); + sb.append(conditions); + sb.append(","); + } + if (!(resourceVersion == null)) { + sb.append("resourceVersion:"); + sb.append(resourceVersion); + } + sb.append("}"); + return sb.toString(); + } + public class ConditionsNested extends V1alpha1MigrationConditionFluent> implements Nested{ + ConditionsNested(int index,V1alpha1MigrationCondition item) { + this.index = index; + this.builder = new V1alpha1MigrationConditionBuilder(this, item); + } + V1alpha1MigrationConditionBuilder builder; + int index; + + public N and() { + return (N) V1alpha1StorageVersionMigrationStatusFluent.this.setToConditions(index, builder.build()); + } + + public N endCondition() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java new file mode 100644 index 0000000000..b3617fbaa0 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java @@ -0,0 +1,36 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1VolumeAttributesClassBuilder extends V1alpha1VolumeAttributesClassFluent implements VisitableBuilder{ + public V1alpha1VolumeAttributesClassBuilder() { + this(new V1alpha1VolumeAttributesClass()); + } + + public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClassFluent fluent) { + this(fluent, new V1alpha1VolumeAttributesClass()); + } + + public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClassFluent fluent,V1alpha1VolumeAttributesClass instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClass instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1VolumeAttributesClassFluent fluent; + + public V1alpha1VolumeAttributesClass build() { + V1alpha1VolumeAttributesClass buildable = new V1alpha1VolumeAttributesClass(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setDriverName(fluent.getDriverName()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + buildable.setParameters(fluent.getParameters()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java new file mode 100644 index 0000000000..23d2c67163 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java @@ -0,0 +1,262 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.util.Optional; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.lang.String; +import java.util.LinkedHashMap; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; +import java.util.Map; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1VolumeAttributesClassFluent> extends BaseFluent{ + public V1alpha1VolumeAttributesClassFluent() { + } + + public V1alpha1VolumeAttributesClassFluent(V1alpha1VolumeAttributesClass instance) { + this.copyInstance(instance); + } + private String apiVersion; + private String driverName; + private String kind; + private V1ObjectMetaBuilder metadata; + private Map parameters; + + protected void copyInstance(V1alpha1VolumeAttributesClass instance) { + instance = instance != null ? instance : new V1alpha1VolumeAttributesClass(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withDriverName(instance.getDriverName()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + this.withParameters(instance.getParameters()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public String getDriverName() { + return this.driverName; + } + + public A withDriverName(String driverName) { + this.driverName = driverName; + return (A) this; + } + + public boolean hasDriverName() { + return this.driverName != null; + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ObjectMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ObjectMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ObjectMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ObjectMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public A addToParameters(String key,String value) { + if (this.parameters == null && key != null && value != null) { + this.parameters = new LinkedHashMap(); + } + if (key != null && value != null) { + this.parameters.put(key, value); + } + return (A) this; + } + + public A addToParameters(Map map) { + if (this.parameters == null && map != null) { + this.parameters = new LinkedHashMap(); + } + if (map != null) { + this.parameters.putAll(map); + } + return (A) this; + } + + public A removeFromParameters(String key) { + if (this.parameters == null) { + return (A) this; + } + if (key != null && this.parameters != null) { + this.parameters.remove(key); + } + return (A) this; + } + + public A removeFromParameters(Map map) { + if (this.parameters == null) { + return (A) this; + } + if (map != null) { + for (Object key : map.keySet()) { + if (this.parameters != null) { + this.parameters.remove(key); + } + } + } + return (A) this; + } + + public Map getParameters() { + return this.parameters; + } + + public A withParameters(Map parameters) { + if (parameters == null) { + this.parameters = null; + } else { + this.parameters = new LinkedHashMap(parameters); + } + return (A) this; + } + + public boolean hasParameters() { + return this.parameters != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1VolumeAttributesClassFluent that = (V1alpha1VolumeAttributesClassFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(driverName, that.driverName))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + if (!(Objects.equals(parameters, that.parameters))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, driverName, kind, metadata, parameters); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(driverName == null)) { + sb.append("driverName:"); + sb.append(driverName); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + sb.append(","); + } + if (!(parameters == null) && !(parameters.isEmpty())) { + sb.append("parameters:"); + sb.append(parameters); + } + sb.append("}"); + return sb.toString(); + } + public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ + MetadataNested(V1ObjectMeta item) { + this.builder = new V1ObjectMetaBuilder(this, item); + } + V1ObjectMetaBuilder builder; + + public N and() { + return (N) V1alpha1VolumeAttributesClassFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java new file mode 100644 index 0000000000..3f5d9ed501 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java @@ -0,0 +1,35 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha1VolumeAttributesClassListBuilder extends V1alpha1VolumeAttributesClassListFluent implements VisitableBuilder{ + public V1alpha1VolumeAttributesClassListBuilder() { + this(new V1alpha1VolumeAttributesClassList()); + } + + public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassListFluent fluent) { + this(fluent, new V1alpha1VolumeAttributesClassList()); + } + + public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassListFluent fluent,V1alpha1VolumeAttributesClassList instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassList instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha1VolumeAttributesClassListFluent fluent; + + public V1alpha1VolumeAttributesClassList build() { + V1alpha1VolumeAttributesClassList buildable = new V1alpha1VolumeAttributesClassList(); + buildable.setApiVersion(fluent.getApiVersion()); + buildable.setItems(fluent.buildItems()); + buildable.setKind(fluent.getKind()); + buildable.setMetadata(fluent.buildMetadata()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java new file mode 100644 index 0000000000..2af3a169ca --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java @@ -0,0 +1,408 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.util.ArrayList; +import java.lang.String; +import java.util.function.Predicate; +import java.lang.RuntimeException; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Objects; +import java.util.Collection; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha1VolumeAttributesClassListFluent> extends BaseFluent{ + public V1alpha1VolumeAttributesClassListFluent() { + } + + public V1alpha1VolumeAttributesClassListFluent(V1alpha1VolumeAttributesClassList instance) { + this.copyInstance(instance); + } + private String apiVersion; + private ArrayList items; + private String kind; + private V1ListMetaBuilder metadata; + + protected void copyInstance(V1alpha1VolumeAttributesClassList instance) { + instance = instance != null ? instance : new V1alpha1VolumeAttributesClassList(); + if (instance != null) { + this.withApiVersion(instance.getApiVersion()); + this.withItems(instance.getItems()); + this.withKind(instance.getKind()); + this.withMetadata(instance.getMetadata()); + } + } + + public String getApiVersion() { + return this.apiVersion; + } + + public A withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return (A) this; + } + + public boolean hasApiVersion() { + return this.apiVersion != null; + } + + public A addToItems(int index,V1alpha1VolumeAttributesClass item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.add(index, builder); + } + return (A) this; + } + + public A setToItems(int index,V1alpha1VolumeAttributesClass item) { + if (this.items == null) { + this.items = new ArrayList(); + } + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + if (index < 0 || index >= items.size()) { + _visitables.get("items").add(builder); + items.add(builder); + } else { + _visitables.get("items").add(builder); + items.set(index, builder); + } + return (A) this; + } + + public A addToItems(V1alpha1VolumeAttributesClass... items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1VolumeAttributesClass item : items) { + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A addAllToItems(Collection items) { + if (this.items == null) { + this.items = new ArrayList(); + } + for (V1alpha1VolumeAttributesClass item : items) { + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + _visitables.get("items").add(builder); + this.items.add(builder); + } + return (A) this; + } + + public A removeFromItems(V1alpha1VolumeAttributesClass... items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1VolumeAttributesClass item : items) { + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeAllFromItems(Collection items) { + if (this.items == null) { + return (A) this; + } + for (V1alpha1VolumeAttributesClass item : items) { + V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); + _visitables.get("items").remove(builder); + this.items.remove(builder); + } + return (A) this; + } + + public A removeMatchingFromItems(Predicate predicate) { + if (items == null) { + return (A) this; + } + Iterator each = items.iterator(); + List visitables = _visitables.get("items"); + while (each.hasNext()) { + V1alpha1VolumeAttributesClassBuilder builder = each.next(); + if (predicate.test(builder)) { + visitables.remove(builder); + each.remove(); + } + } + return (A) this; + } + + public List buildItems() { + return this.items != null ? build(items) : null; + } + + public V1alpha1VolumeAttributesClass buildItem(int index) { + return this.items.get(index).build(); + } + + public V1alpha1VolumeAttributesClass buildFirstItem() { + return this.items.get(0).build(); + } + + public V1alpha1VolumeAttributesClass buildLastItem() { + return this.items.get(items.size() - 1).build(); + } + + public V1alpha1VolumeAttributesClass buildMatchingItem(Predicate predicate) { + for (V1alpha1VolumeAttributesClassBuilder item : items) { + if (predicate.test(item)) { + return item.build(); + } + } + return null; + } + + public boolean hasMatchingItem(Predicate predicate) { + for (V1alpha1VolumeAttributesClassBuilder item : items) { + if (predicate.test(item)) { + return true; + } + } + return false; + } + + public A withItems(List items) { + if (this.items != null) { + this._visitables.get("items").clear(); + } + if (items != null) { + this.items = new ArrayList(); + for (V1alpha1VolumeAttributesClass item : items) { + this.addToItems(item); + } + } else { + this.items = null; + } + return (A) this; + } + + public A withItems(V1alpha1VolumeAttributesClass... items) { + if (this.items != null) { + this.items.clear(); + _visitables.remove("items"); + } + if (items != null) { + for (V1alpha1VolumeAttributesClass item : items) { + this.addToItems(item); + } + } + return (A) this; + } + + public boolean hasItems() { + return this.items != null && !(this.items.isEmpty()); + } + + public ItemsNested addNewItem() { + return new ItemsNested(-1, null); + } + + public ItemsNested addNewItemLike(V1alpha1VolumeAttributesClass item) { + return new ItemsNested(-1, item); + } + + public ItemsNested setNewItemLike(int index,V1alpha1VolumeAttributesClass item) { + return new ItemsNested(index, item); + } + + public ItemsNested editItem(int index) { + if (index <= items.size()) { + throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editFirstItem() { + if (items.size() == 0) { + throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); + } + return this.setNewItemLike(0, this.buildItem(0)); + } + + public ItemsNested editLastItem() { + int index = items.size() - 1; + if (index < 0) { + throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public ItemsNested editMatchingItem(Predicate predicate) { + int index = -1; + for (int i = 0;i < items.size();i++) { + if (predicate.test(items.get(i))) { + index = i; + break; + } + } + if (index < 0) { + throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); + } + return this.setNewItemLike(index, this.buildItem(index)); + } + + public String getKind() { + return this.kind; + } + + public A withKind(String kind) { + this.kind = kind; + return (A) this; + } + + public boolean hasKind() { + return this.kind != null; + } + + public V1ListMeta buildMetadata() { + return this.metadata != null ? this.metadata.build() : null; + } + + public A withMetadata(V1ListMeta metadata) { + this._visitables.remove("metadata"); + if (metadata != null) { + this.metadata = new V1ListMetaBuilder(metadata); + this._visitables.get("metadata").add(this.metadata); + } else { + this.metadata = null; + this._visitables.get("metadata").remove(this.metadata); + } + return (A) this; + } + + public boolean hasMetadata() { + return this.metadata != null; + } + + public MetadataNested withNewMetadata() { + return new MetadataNested(null); + } + + public MetadataNested withNewMetadataLike(V1ListMeta item) { + return new MetadataNested(item); + } + + public MetadataNested editMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); + } + + public MetadataNested editOrNewMetadata() { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); + } + + public MetadataNested editOrNewMetadataLike(V1ListMeta item) { + return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha1VolumeAttributesClassListFluent that = (V1alpha1VolumeAttributesClassListFluent) o; + if (!(Objects.equals(apiVersion, that.apiVersion))) { + return false; + } + if (!(Objects.equals(items, that.items))) { + return false; + } + if (!(Objects.equals(kind, that.kind))) { + return false; + } + if (!(Objects.equals(metadata, that.metadata))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(apiVersion == null)) { + sb.append("apiVersion:"); + sb.append(apiVersion); + sb.append(","); + } + if (!(items == null) && !(items.isEmpty())) { + sb.append("items:"); + sb.append(items); + sb.append(","); + } + if (!(kind == null)) { + sb.append("kind:"); + sb.append(kind); + sb.append(","); + } + if (!(metadata == null)) { + sb.append("metadata:"); + sb.append(metadata); + } + sb.append("}"); + return sb.toString(); + } + public class ItemsNested extends V1alpha1VolumeAttributesClassFluent> implements Nested{ + ItemsNested(int index,V1alpha1VolumeAttributesClass item) { + this.index = index; + this.builder = new V1alpha1VolumeAttributesClassBuilder(this, item); + } + V1alpha1VolumeAttributesClassBuilder builder; + int index; + + public N and() { + return (N) V1alpha1VolumeAttributesClassListFluent.this.setToItems(index, builder.build()); + } + + public N endItem() { + return and(); + } + + + } + public class MetadataNested extends V1ListMetaFluent> implements Nested{ + MetadataNested(V1ListMeta item) { + this.builder = new V1ListMetaBuilder(this, item); + } + V1ListMetaBuilder builder; + + public N and() { + return (N) V1alpha1VolumeAttributesClassListFluent.this.withMetadata(builder.build()); + } + + public N endMetadata() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java new file mode 100644 index 0000000000..b1315f31cb --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java @@ -0,0 +1,32 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha3CELDeviceSelectorBuilder extends V1alpha3CELDeviceSelectorFluent implements VisitableBuilder{ + public V1alpha3CELDeviceSelectorBuilder() { + this(new V1alpha3CELDeviceSelector()); + } + + public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelectorFluent fluent) { + this(fluent, new V1alpha3CELDeviceSelector()); + } + + public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelectorFluent fluent,V1alpha3CELDeviceSelector instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelector instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha3CELDeviceSelectorFluent fluent; + + public V1alpha3CELDeviceSelector build() { + V1alpha3CELDeviceSelector buildable = new V1alpha3CELDeviceSelector(); + buildable.setExpression(fluent.getExpression()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java new file mode 100644 index 0000000000..3c4cf6b918 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java @@ -0,0 +1,76 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; +import java.lang.String; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha3CELDeviceSelectorFluent> extends BaseFluent{ + public V1alpha3CELDeviceSelectorFluent() { + } + + public V1alpha3CELDeviceSelectorFluent(V1alpha3CELDeviceSelector instance) { + this.copyInstance(instance); + } + private String expression; + + protected void copyInstance(V1alpha3CELDeviceSelector instance) { + instance = instance != null ? instance : new V1alpha3CELDeviceSelector(); + if (instance != null) { + this.withExpression(instance.getExpression()); + } + } + + public String getExpression() { + return this.expression; + } + + public A withExpression(String expression) { + this.expression = expression; + return (A) this; + } + + public boolean hasExpression() { + return this.expression != null; + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha3CELDeviceSelectorFluent that = (V1alpha3CELDeviceSelectorFluent) o; + if (!(Objects.equals(expression, that.expression))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(expression); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(expression == null)) { + sb.append("expression:"); + sb.append(expression); + } + sb.append("}"); + return sb.toString(); + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java new file mode 100644 index 0000000000..9769e4a9b1 --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java @@ -0,0 +1,32 @@ +package io.kubernetes.client.openapi.models; + +import io.kubernetes.client.fluent.VisitableBuilder; +import java.lang.Object; +public class V1alpha3DeviceSelectorBuilder extends V1alpha3DeviceSelectorFluent implements VisitableBuilder{ + public V1alpha3DeviceSelectorBuilder() { + this(new V1alpha3DeviceSelector()); + } + + public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelectorFluent fluent) { + this(fluent, new V1alpha3DeviceSelector()); + } + + public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelectorFluent fluent,V1alpha3DeviceSelector instance) { + this.fluent = fluent; + fluent.copyInstance(instance); + } + + public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelector instance) { + this.fluent = this; + this.copyInstance(instance); + } + V1alpha3DeviceSelectorFluent fluent; + + public V1alpha3DeviceSelector build() { + V1alpha3DeviceSelector buildable = new V1alpha3DeviceSelector(); + buildable.setCel(fluent.buildCel()); + return buildable; + } + + +} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java new file mode 100644 index 0000000000..908851fc9e --- /dev/null +++ b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java @@ -0,0 +1,120 @@ +package io.kubernetes.client.openapi.models; + +import java.lang.StringBuilder; +import java.util.Optional; +import java.lang.SuppressWarnings; +import io.kubernetes.client.fluent.Nested; +import java.lang.String; +import io.kubernetes.client.fluent.BaseFluent; +import java.util.Objects; +import java.lang.Object; + +/** + * Generated + */ +@SuppressWarnings("unchecked") +public class V1alpha3DeviceSelectorFluent> extends BaseFluent{ + public V1alpha3DeviceSelectorFluent() { + } + + public V1alpha3DeviceSelectorFluent(V1alpha3DeviceSelector instance) { + this.copyInstance(instance); + } + private V1alpha3CELDeviceSelectorBuilder cel; + + protected void copyInstance(V1alpha3DeviceSelector instance) { + instance = instance != null ? instance : new V1alpha3DeviceSelector(); + if (instance != null) { + this.withCel(instance.getCel()); + } + } + + public V1alpha3CELDeviceSelector buildCel() { + return this.cel != null ? this.cel.build() : null; + } + + public A withCel(V1alpha3CELDeviceSelector cel) { + this._visitables.remove("cel"); + if (cel != null) { + this.cel = new V1alpha3CELDeviceSelectorBuilder(cel); + this._visitables.get("cel").add(this.cel); + } else { + this.cel = null; + this._visitables.get("cel").remove(this.cel); + } + return (A) this; + } + + public boolean hasCel() { + return this.cel != null; + } + + public CelNested withNewCel() { + return new CelNested(null); + } + + public CelNested withNewCelLike(V1alpha3CELDeviceSelector item) { + return new CelNested(item); + } + + public CelNested editCel() { + return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(null)); + } + + public CelNested editOrNewCel() { + return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(new V1alpha3CELDeviceSelectorBuilder().build())); + } + + public CelNested editOrNewCelLike(V1alpha3CELDeviceSelector item) { + return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(item)); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + if (!(super.equals(o))) { + return false; + } + V1alpha3DeviceSelectorFluent that = (V1alpha3DeviceSelectorFluent) o; + if (!(Objects.equals(cel, that.cel))) { + return false; + } + return true; + } + + public int hashCode() { + return Objects.hash(cel); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (!(cel == null)) { + sb.append("cel:"); + sb.append(cel); + } + sb.append("}"); + return sb.toString(); + } + public class CelNested extends V1alpha3CELDeviceSelectorFluent> implements Nested{ + CelNested(V1alpha3CELDeviceSelector item) { + this.builder = new V1alpha3CELDeviceSelectorBuilder(this, item); + } + V1alpha3CELDeviceSelectorBuilder builder; + + public N and() { + return (N) V1alpha3DeviceSelectorFluent.this.withCel(builder.build()); + } + + public N endCel() { + return and(); + } + + + } + +} \ No newline at end of file diff --git a/kubernetes/docs/StorageV1alpha1Api.md b/kubernetes/docs/StorageV1alpha1Api.md new file mode 100644 index 0000000000..4a704f6eab --- /dev/null +++ b/kubernetes/docs/StorageV1alpha1Api.md @@ -0,0 +1,671 @@ +# StorageV1alpha1Api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createVolumeAttributesClass**](StorageV1alpha1Api.md#createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | +[**deleteCollectionVolumeAttributesClass**](StorageV1alpha1Api.md#deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | +[**deleteVolumeAttributesClass**](StorageV1alpha1Api.md#deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | +[**getAPIResources**](StorageV1alpha1Api.md#getAPIResources) | **GET** /apis/storage.k8s.io/v1alpha1/ | +[**listVolumeAttributesClass**](StorageV1alpha1Api.md#listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | +[**patchVolumeAttributesClass**](StorageV1alpha1Api.md#patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | +[**readVolumeAttributesClass**](StorageV1alpha1Api.md#readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | +[**replaceVolumeAttributesClass**](StorageV1alpha1Api.md#replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | + + + +# **createVolumeAttributesClass** +> V1alpha1VolumeAttributesClass createVolumeAttributesClass(body, pretty, dryRun, fieldManager, fieldValidation) + + + +create a VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + V1alpha1VolumeAttributesClass body = new V1alpha1VolumeAttributesClass(); // V1alpha1VolumeAttributesClass | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + try { + V1alpha1VolumeAttributesClass result = apiInstance.createVolumeAttributesClass(body, pretty, dryRun, fieldManager, fieldValidation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#createVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md)| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**202** | Accepted | - | +**401** | Unauthorized | - | + + +# **deleteCollectionVolumeAttributesClass** +> V1Status deleteCollectionVolumeAttributesClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body) + + + +delete collection of VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. + Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. + Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | + try { + V1Status result = apiInstance.deleteCollectionVolumeAttributesClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#deleteCollectionVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] + **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] + **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] + **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] + **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] + **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] + **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] + **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] + **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] + **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] + +### Return type + +[**V1Status**](V1Status.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **deleteVolumeAttributesClass** +> V1alpha1VolumeAttributesClass deleteVolumeAttributesClass(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body) + + + +delete a VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the VolumeAttributesClass + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | + try { + V1alpha1VolumeAttributesClass result = apiInstance.deleteVolumeAttributesClass(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#deleteVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the VolumeAttributesClass | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] + **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] + **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] + **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] + **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**202** | Accepted | - | +**401** | Unauthorized | - | + + +# **getAPIResources** +> V1APIResourceList getAPIResources() + + + +get available resources + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + try { + V1APIResourceList result = apiInstance.getAPIResources(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#getAPIResources"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**V1APIResourceList**](V1APIResourceList.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **listVolumeAttributesClass** +> V1alpha1VolumeAttributesClassList listVolumeAttributesClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch) + + + +list or watch objects of kind VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + Boolean allowWatchBookmarks = true; // Boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. + String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. + Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + Boolean watch = true; // Boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + try { + V1alpha1VolumeAttributesClassList result = apiInstance.listVolumeAttributesClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#listVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **allowWatchBookmarks** | **Boolean**| allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. | [optional] + **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] + **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] + **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] + **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] + **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] + **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] + **watch** | **Boolean**| Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClassList**](V1alpha1VolumeAttributesClassList.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **patchVolumeAttributesClass** +> V1alpha1VolumeAttributesClass patchVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation, force) + + + +partially update the specified VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the VolumeAttributesClass + V1Patch body = new V1Patch(); // V1Patch | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + try { + V1alpha1VolumeAttributesClass result = apiInstance.patchVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#patchVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the VolumeAttributesClass | + **body** | **V1Patch**| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + + +# **readVolumeAttributesClass** +> V1alpha1VolumeAttributesClass readVolumeAttributesClass(name, pretty) + + + +read the specified VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the VolumeAttributesClass + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + try { + V1alpha1VolumeAttributesClass result = apiInstance.readVolumeAttributesClass(name, pretty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#readVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the VolumeAttributesClass | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **replaceVolumeAttributesClass** +> V1alpha1VolumeAttributesClass replaceVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation) + + + +replace the specified VolumeAttributesClass + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the VolumeAttributesClass + V1alpha1VolumeAttributesClass body = new V1alpha1VolumeAttributesClass(); // V1alpha1VolumeAttributesClass | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + try { + V1alpha1VolumeAttributesClass result = apiInstance.replaceVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StorageV1alpha1Api#replaceVolumeAttributesClass"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the VolumeAttributesClass | + **body** | [**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md)| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + diff --git a/kubernetes/docs/StoragemigrationV1alpha1Api.md b/kubernetes/docs/StoragemigrationV1alpha1Api.md new file mode 100644 index 0000000000..8f709073c1 --- /dev/null +++ b/kubernetes/docs/StoragemigrationV1alpha1Api.md @@ -0,0 +1,910 @@ +# StoragemigrationV1alpha1Api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createStorageVersionMigration**](StoragemigrationV1alpha1Api.md#createStorageVersionMigration) | **POST** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | +[**deleteCollectionStorageVersionMigration**](StoragemigrationV1alpha1Api.md#deleteCollectionStorageVersionMigration) | **DELETE** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | +[**deleteStorageVersionMigration**](StoragemigrationV1alpha1Api.md#deleteStorageVersionMigration) | **DELETE** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | +[**getAPIResources**](StoragemigrationV1alpha1Api.md#getAPIResources) | **GET** /apis/storagemigration.k8s.io/v1alpha1/ | +[**listStorageVersionMigration**](StoragemigrationV1alpha1Api.md#listStorageVersionMigration) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | +[**patchStorageVersionMigration**](StoragemigrationV1alpha1Api.md#patchStorageVersionMigration) | **PATCH** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | +[**patchStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#patchStorageVersionMigrationStatus) | **PATCH** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | +[**readStorageVersionMigration**](StoragemigrationV1alpha1Api.md#readStorageVersionMigration) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | +[**readStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#readStorageVersionMigrationStatus) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | +[**replaceStorageVersionMigration**](StoragemigrationV1alpha1Api.md#replaceStorageVersionMigration) | **PUT** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | +[**replaceStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#replaceStorageVersionMigrationStatus) | **PUT** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | + + + +# **createStorageVersionMigration** +> V1alpha1StorageVersionMigration createStorageVersionMigration(body, pretty, dryRun, fieldManager, fieldValidation) + + + +create a StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + try { + V1alpha1StorageVersionMigration result = apiInstance.createStorageVersionMigration(body, pretty, dryRun, fieldManager, fieldValidation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#createStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**202** | Accepted | - | +**401** | Unauthorized | - | + + +# **deleteCollectionStorageVersionMigration** +> V1Status deleteCollectionStorageVersionMigration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body) + + + +delete collection of StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. + Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. + Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | + try { + V1Status result = apiInstance.deleteCollectionStorageVersionMigration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#deleteCollectionStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] + **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] + **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] + **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] + **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] + **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] + **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] + **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] + **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] + **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] + +### Return type + +[**V1Status**](V1Status.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **deleteStorageVersionMigration** +> V1Status deleteStorageVersionMigration(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body) + + + +delete a StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | + try { + V1Status result = apiInstance.deleteStorageVersionMigration(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#deleteStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] + **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] + **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] + **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] + **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] + +### Return type + +[**V1Status**](V1Status.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**202** | Accepted | - | +**401** | Unauthorized | - | + + +# **getAPIResources** +> V1APIResourceList getAPIResources() + + + +get available resources + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + try { + V1APIResourceList result = apiInstance.getAPIResources(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#getAPIResources"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**V1APIResourceList**](V1APIResourceList.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **listStorageVersionMigration** +> V1alpha1StorageVersionMigrationList listStorageVersionMigration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch) + + + +list or watch objects of kind StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + Boolean allowWatchBookmarks = true; // Boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. + String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. + Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + Boolean watch = true; // Boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + try { + V1alpha1StorageVersionMigrationList result = apiInstance.listStorageVersionMigration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#listStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **allowWatchBookmarks** | **Boolean**| allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. | [optional] + **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] + **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] + **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] + **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] + **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] + **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] + **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] + **watch** | **Boolean**| Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigrationList**](V1alpha1StorageVersionMigrationList.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **patchStorageVersionMigration** +> V1alpha1StorageVersionMigration patchStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation, force) + + + +partially update the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + V1Patch body = new V1Patch(); // V1Patch | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + try { + V1alpha1StorageVersionMigration result = apiInstance.patchStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#patchStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **body** | **V1Patch**| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + + +# **patchStorageVersionMigrationStatus** +> V1alpha1StorageVersionMigration patchStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation, force) + + + +partially update status of the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + V1Patch body = new V1Patch(); // V1Patch | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + try { + V1alpha1StorageVersionMigration result = apiInstance.patchStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#patchStorageVersionMigrationStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **body** | **V1Patch**| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + + +# **readStorageVersionMigration** +> V1alpha1StorageVersionMigration readStorageVersionMigration(name, pretty) + + + +read the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + try { + V1alpha1StorageVersionMigration result = apiInstance.readStorageVersionMigration(name, pretty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#readStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **readStorageVersionMigrationStatus** +> V1alpha1StorageVersionMigration readStorageVersionMigrationStatus(name, pretty) + + + +read status of the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + try { + V1alpha1StorageVersionMigration result = apiInstance.readStorageVersionMigrationStatus(name, pretty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#readStorageVersionMigrationStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | + + +# **replaceStorageVersionMigration** +> V1alpha1StorageVersionMigration replaceStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation) + + + +replace the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + try { + V1alpha1StorageVersionMigration result = apiInstance.replaceStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#replaceStorageVersionMigration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + + +# **replaceStorageVersionMigrationStatus** +> V1alpha1StorageVersionMigration replaceStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation) + + + +replace status of the specified StorageVersionMigration + +### Example +```java +// Import classes: +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.auth.*; +import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: BearerToken + ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); + BearerToken.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //BearerToken.setApiKeyPrefix("Token"); + + StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); + String name = "name_example"; // String | name of the StorageVersionMigration + V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | + String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + try { + V1alpha1StorageVersionMigration result = apiInstance.replaceStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragemigrationV1alpha1Api#replaceStorageVersionMigrationStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| name of the StorageVersionMigration | + **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | + **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] + **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] + **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] + **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] + +### Return type + +[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**401** | Unauthorized | - | + diff --git a/kubernetes/docs/V1alpha1GroupVersionResource.md b/kubernetes/docs/V1alpha1GroupVersionResource.md new file mode 100644 index 0000000000..e6ac68c480 --- /dev/null +++ b/kubernetes/docs/V1alpha1GroupVersionResource.md @@ -0,0 +1,15 @@ + + +# V1alpha1GroupVersionResource + +The names of the group, the version, and the resource. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **String** | The name of the group. | [optional] +**resource** | **String** | The name of the resource. | [optional] +**version** | **String** | The name of the version. | [optional] + + + diff --git a/kubernetes/docs/V1alpha1MigrationCondition.md b/kubernetes/docs/V1alpha1MigrationCondition.md new file mode 100644 index 0000000000..c52aa3d698 --- /dev/null +++ b/kubernetes/docs/V1alpha1MigrationCondition.md @@ -0,0 +1,17 @@ + + +# V1alpha1MigrationCondition + +Describes the state of a migration at a certain point. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lastUpdateTime** | [**OffsetDateTime**](OffsetDateTime.md) | The last time this condition was updated. | [optional] +**message** | **String** | A human readable message indicating details about the transition. | [optional] +**reason** | **String** | The reason for the condition's last transition. | [optional] +**status** | **String** | Status of the condition, one of True, False, Unknown. | +**type** | **String** | Type of the condition. | + + + diff --git a/kubernetes/docs/V1alpha1PodCertificateRequest.md b/kubernetes/docs/V1alpha1PodCertificateRequest.md new file mode 100644 index 0000000000..57f492e903 --- /dev/null +++ b/kubernetes/docs/V1alpha1PodCertificateRequest.md @@ -0,0 +1,21 @@ + + +# V1alpha1PodCertificateRequest + +PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] +**spec** | [**V1alpha1PodCertificateRequestSpec**](V1alpha1PodCertificateRequestSpec.md) | | +**status** | [**V1alpha1PodCertificateRequestStatus**](V1alpha1PodCertificateRequestStatus.md) | | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesObject + + diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestList.md b/kubernetes/docs/V1alpha1PodCertificateRequestList.md new file mode 100644 index 0000000000..813fda93b7 --- /dev/null +++ b/kubernetes/docs/V1alpha1PodCertificateRequestList.md @@ -0,0 +1,20 @@ + + +# V1alpha1PodCertificateRequestList + +PodCertificateRequestList is a collection of PodCertificateRequest objects +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**List<V1alpha1PodCertificateRequest>**](V1alpha1PodCertificateRequest.md) | items is a collection of PodCertificateRequest objects | +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesListObject + + diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md b/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md new file mode 100644 index 0000000000..679098f546 --- /dev/null +++ b/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md @@ -0,0 +1,22 @@ + + +# V1alpha1PodCertificateRequestSpec + +PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxExpirationSeconds** | **Integer** | maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. | [optional] +**nodeName** | **String** | nodeName is the name of the node the pod is assigned to. | +**nodeUID** | **String** | nodeUID is the UID of the node the pod is assigned to. | +**pkixPublicKey** | **byte[]** | pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field. | +**podName** | **String** | podName is the name of the pod into which the certificate will be mounted. | +**podUID** | **String** | podUID is the UID of the pod into which the certificate will be mounted. | +**proofOfPossession** | **byte[]** | proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign). | +**serviceAccountName** | **String** | serviceAccountName is the name of the service account the pod is running as. | +**serviceAccountUID** | **String** | serviceAccountUID is the UID of the service account the pod is running as. | +**signerName** | **String** | signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented. | + + + diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md b/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md new file mode 100644 index 0000000000..c7088709d7 --- /dev/null +++ b/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md @@ -0,0 +1,17 @@ + + +# V1alpha1PodCertificateRequestStatus + +PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**beginRefreshAt** | [**OffsetDateTime**](OffsetDateTime.md) | beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary. | [optional] +**certificateChain** | **String** | certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers. | [optional] +**conditions** | [**List<V1Condition>**](V1Condition.md) | conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field. | [optional] +**notAfter** | [**OffsetDateTime**](OffsetDateTime.md) | notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] +**notBefore** | [**OffsetDateTime**](OffsetDateTime.md) | notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] + + + diff --git a/kubernetes/docs/V1alpha1StorageVersionMigration.md b/kubernetes/docs/V1alpha1StorageVersionMigration.md new file mode 100644 index 0000000000..761cc1174c --- /dev/null +++ b/kubernetes/docs/V1alpha1StorageVersionMigration.md @@ -0,0 +1,21 @@ + + +# V1alpha1StorageVersionMigration + +StorageVersionMigration represents a migration of stored data to the latest storage version. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] +**spec** | [**V1alpha1StorageVersionMigrationSpec**](V1alpha1StorageVersionMigrationSpec.md) | | [optional] +**status** | [**V1alpha1StorageVersionMigrationStatus**](V1alpha1StorageVersionMigrationStatus.md) | | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesObject + + diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationList.md b/kubernetes/docs/V1alpha1StorageVersionMigrationList.md new file mode 100644 index 0000000000..9caae53227 --- /dev/null +++ b/kubernetes/docs/V1alpha1StorageVersionMigrationList.md @@ -0,0 +1,20 @@ + + +# V1alpha1StorageVersionMigrationList + +StorageVersionMigrationList is a collection of storage version migrations. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**List<V1alpha1StorageVersionMigration>**](V1alpha1StorageVersionMigration.md) | Items is the list of StorageVersionMigration | +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesListObject + + diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md b/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md new file mode 100644 index 0000000000..fd290a2607 --- /dev/null +++ b/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md @@ -0,0 +1,14 @@ + + +# V1alpha1StorageVersionMigrationSpec + +Spec of the storage version migration. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**continueToken** | **String** | The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration. | [optional] +**resource** | [**V1alpha1GroupVersionResource**](V1alpha1GroupVersionResource.md) | | + + + diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md b/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md new file mode 100644 index 0000000000..3515aad65d --- /dev/null +++ b/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md @@ -0,0 +1,14 @@ + + +# V1alpha1StorageVersionMigrationStatus + +Status of the storage version migration. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**List<V1alpha1MigrationCondition>**](V1alpha1MigrationCondition.md) | The latest available observations of the migration's current state. | [optional] +**resourceVersion** | **String** | ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource. | [optional] + + + diff --git a/kubernetes/docs/V1alpha1VolumeAttributesClass.md b/kubernetes/docs/V1alpha1VolumeAttributesClass.md new file mode 100644 index 0000000000..ab0f8a55f8 --- /dev/null +++ b/kubernetes/docs/V1alpha1VolumeAttributesClass.md @@ -0,0 +1,21 @@ + + +# V1alpha1VolumeAttributesClass + +VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**driverName** | **String** | Name of the CSI driver This field is immutable. | +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] +**parameters** | **Map<String, String>** | parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesObject + + diff --git a/kubernetes/docs/V1alpha1VolumeAttributesClassList.md b/kubernetes/docs/V1alpha1VolumeAttributesClassList.md new file mode 100644 index 0000000000..298e8ebd2d --- /dev/null +++ b/kubernetes/docs/V1alpha1VolumeAttributesClassList.md @@ -0,0 +1,20 @@ + + +# V1alpha1VolumeAttributesClassList + +VolumeAttributesClassList is a collection of VolumeAttributesClass objects. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] +**items** | [**List<V1alpha1VolumeAttributesClass>**](V1alpha1VolumeAttributesClass.md) | items is the list of VolumeAttributesClass objects. | +**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] +**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] + + +## Implemented Interfaces + +* io.kubernetes.client.common.KubernetesListObject + + diff --git a/kubernetes/docs/V1alpha3CELDeviceSelector.md b/kubernetes/docs/V1alpha3CELDeviceSelector.md new file mode 100644 index 0000000000..b23dac3f1a --- /dev/null +++ b/kubernetes/docs/V1alpha3CELDeviceSelector.md @@ -0,0 +1,13 @@ + + +# V1alpha3CELDeviceSelector + +CELDeviceSelector contains a CEL expression for selecting a device. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expression** | **String** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | + + + diff --git a/kubernetes/docs/V1alpha3DeviceSelector.md b/kubernetes/docs/V1alpha3DeviceSelector.md new file mode 100644 index 0000000000..f9fbf49104 --- /dev/null +++ b/kubernetes/docs/V1alpha3DeviceSelector.md @@ -0,0 +1,13 @@ + + +# V1alpha3DeviceSelector + +DeviceSelector must have exactly one field set. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cel** | [**V1alpha3CELDeviceSelector**](V1alpha3CELDeviceSelector.md) | | [optional] + + + diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java new file mode 100644 index 0000000000..a934cfb445 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java @@ -0,0 +1,1356 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.apis; + +import io.kubernetes.client.openapi.ApiCallback; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.ApiResponse; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.Pair; +import io.kubernetes.client.openapi.ProgressRequestBody; +import io.kubernetes.client.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.kubernetes.client.openapi.models.V1APIResourceList; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.models.V1Status; +import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClass; +import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClassList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StorageV1alpha1Api { + private ApiClient localVarApiClient; + + public StorageV1alpha1Api() { + this(Configuration.getDefaultApiClient()); + } + + public StorageV1alpha1Api(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for createVolumeAttributesClass + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call createVolumeAttributesClassCall(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createVolumeAttributesClassValidateBeforeCall(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createVolumeAttributesClass(Async)"); + } + + + okhttp3.Call localVarCall = createVolumeAttributesClassCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); + return localVarCall; + + } + + /** + * + * create a VolumeAttributesClass + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return V1alpha1VolumeAttributesClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClass createVolumeAttributesClass(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + ApiResponse localVarResp = createVolumeAttributesClassWithHttpInfo(body, pretty, dryRun, fieldManager, fieldValidation); + return localVarResp.getData(); + } + + /** + * + * create a VolumeAttributesClass + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public ApiResponse createVolumeAttributesClassWithHttpInfo(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + okhttp3.Call localVarCall = createVolumeAttributesClassValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * create a VolumeAttributesClass + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call createVolumeAttributesClassAsync(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createVolumeAttributesClassValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCollectionVolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call deleteCollectionVolumeAttributesClassCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (_continue != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); + } + + if (gracePeriodSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); + } + + if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); + } + + if (labelSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (orphanDependents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); + } + + if (propagationPolicy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); + } + + if (resourceVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); + } + + if (resourceVersionMatch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); + } + + if (sendInitialEvents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); + } + + if (timeoutSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCollectionVolumeAttributesClassValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); + return localVarCall; + + } + + /** + * + * delete collection of VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @return V1Status + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1Status deleteCollectionVolumeAttributesClass(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { + ApiResponse localVarResp = deleteCollectionVolumeAttributesClassWithHttpInfo(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); + return localVarResp.getData(); + } + + /** + * + * delete collection of VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @return ApiResponse<V1Status> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse deleteCollectionVolumeAttributesClassWithHttpInfo(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { + okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * delete collection of VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call deleteCollectionVolumeAttributesClassAsync(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteVolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call deleteVolumeAttributesClassCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (gracePeriodSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); + } + + if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); + } + + if (orphanDependents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); + } + + if (propagationPolicy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteVolumeAttributesClassValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteVolumeAttributesClass(Async)"); + } + + + okhttp3.Call localVarCall = deleteVolumeAttributesClassCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); + return localVarCall; + + } + + /** + * + * delete a VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @return V1alpha1VolumeAttributesClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClass deleteVolumeAttributesClass(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { + ApiResponse localVarResp = deleteVolumeAttributesClassWithHttpInfo(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); + return localVarResp.getData(); + } + + /** + * + * delete a VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public ApiResponse deleteVolumeAttributesClassWithHttpInfo(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { + okhttp3.Call localVarCall = deleteVolumeAttributesClassValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * delete a VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call deleteVolumeAttributesClassAsync(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteVolumeAttributesClassValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAPIResources + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getAPIResourcesCall(_callback); + return localVarCall; + + } + + /** + * + * get available resources + * @return V1APIResourceList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1APIResourceList getAPIResources() throws ApiException { + ApiResponse localVarResp = getAPIResourcesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * get available resources + * @return ApiResponse<V1APIResourceList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse getAPIResourcesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * get available resources + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call getAPIResourcesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listVolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call listVolumeAttributesClassCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (allowWatchBookmarks != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowWatchBookmarks", allowWatchBookmarks)); + } + + if (_continue != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); + } + + if (fieldSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); + } + + if (labelSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (resourceVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); + } + + if (resourceVersionMatch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); + } + + if (sendInitialEvents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); + } + + if (timeoutSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); + } + + if (watch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch", "application/cbor-seq" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listVolumeAttributesClassValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = listVolumeAttributesClassCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); + return localVarCall; + + } + + /** + * + * list or watch objects of kind VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @return V1alpha1VolumeAttributesClassList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClassList listVolumeAttributesClass(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { + ApiResponse localVarResp = listVolumeAttributesClassWithHttpInfo(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); + return localVarResp.getData(); + } + + /** + * + * list or watch objects of kind VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClassList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse listVolumeAttributesClassWithHttpInfo(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { + okhttp3.Call localVarCall = listVolumeAttributesClassValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * list or watch objects of kind VolumeAttributesClass + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call listVolumeAttributesClassAsync(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listVolumeAttributesClassValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for patchVolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchVolumeAttributesClassCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call patchVolumeAttributesClassValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling patchVolumeAttributesClass(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling patchVolumeAttributesClass(Async)"); + } + + + okhttp3.Call localVarCall = patchVolumeAttributesClassCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + return localVarCall; + + } + + /** + * + * partially update the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return V1alpha1VolumeAttributesClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClass patchVolumeAttributesClass(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + ApiResponse localVarResp = patchVolumeAttributesClassWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + return localVarResp.getData(); + } + + /** + * + * partially update the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse patchVolumeAttributesClassWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + okhttp3.Call localVarCall = patchVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * partially update the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchVolumeAttributesClassAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = patchVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for readVolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readVolumeAttributesClassCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call readVolumeAttributesClassValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling readVolumeAttributesClass(Async)"); + } + + + okhttp3.Call localVarCall = readVolumeAttributesClassCall(name, pretty, _callback); + return localVarCall; + + } + + /** + * + * read the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return V1alpha1VolumeAttributesClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClass readVolumeAttributesClass(String name, String pretty) throws ApiException { + ApiResponse localVarResp = readVolumeAttributesClassWithHttpInfo(name, pretty); + return localVarResp.getData(); + } + + /** + * + * read the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse readVolumeAttributesClassWithHttpInfo(String name, String pretty) throws ApiException { + okhttp3.Call localVarCall = readVolumeAttributesClassValidateBeforeCall(name, pretty, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * read the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readVolumeAttributesClassAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = readVolumeAttributesClassValidateBeforeCall(name, pretty, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceVolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceVolumeAttributesClassCall(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceVolumeAttributesClassValidateBeforeCall(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling replaceVolumeAttributesClass(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling replaceVolumeAttributesClass(Async)"); + } + + + okhttp3.Call localVarCall = replaceVolumeAttributesClassCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + return localVarCall; + + } + + /** + * + * replace the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return V1alpha1VolumeAttributesClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1VolumeAttributesClass replaceVolumeAttributesClass(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + ApiResponse localVarResp = replaceVolumeAttributesClassWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); + return localVarResp.getData(); + } + + /** + * + * replace the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return ApiResponse<V1alpha1VolumeAttributesClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse replaceVolumeAttributesClassWithHttpInfo(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + okhttp3.Call localVarCall = replaceVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * replace the specified VolumeAttributesClass + * @param name name of the VolumeAttributesClass (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceVolumeAttributesClassAsync(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java new file mode 100644 index 0000000000..5ffa7704ba --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java @@ -0,0 +1,1807 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.apis; + +import io.kubernetes.client.openapi.ApiCallback; +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.ApiResponse; +import io.kubernetes.client.openapi.Configuration; +import io.kubernetes.client.openapi.Pair; +import io.kubernetes.client.openapi.ProgressRequestBody; +import io.kubernetes.client.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.kubernetes.client.openapi.models.V1APIResourceList; +import io.kubernetes.client.openapi.models.V1DeleteOptions; +import io.kubernetes.client.custom.V1Patch; +import io.kubernetes.client.openapi.models.V1Status; +import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigration; +import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StoragemigrationV1alpha1Api { + private ApiClient localVarApiClient; + + public StoragemigrationV1alpha1Api() { + this(Configuration.getDefaultApiClient()); + } + + public StoragemigrationV1alpha1Api(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for createStorageVersionMigration + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call createStorageVersionMigrationCall(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createStorageVersionMigrationValidateBeforeCall(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createStorageVersionMigration(Async)"); + } + + + okhttp3.Call localVarCall = createStorageVersionMigrationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); + return localVarCall; + + } + + /** + * + * create a StorageVersionMigration + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration createStorageVersionMigration(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + ApiResponse localVarResp = createStorageVersionMigrationWithHttpInfo(body, pretty, dryRun, fieldManager, fieldValidation); + return localVarResp.getData(); + } + + /** + * + * create a StorageVersionMigration + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public ApiResponse createStorageVersionMigrationWithHttpInfo(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + okhttp3.Call localVarCall = createStorageVersionMigrationValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * create a StorageVersionMigration + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call createStorageVersionMigrationAsync(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createStorageVersionMigrationValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCollectionStorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call deleteCollectionStorageVersionMigrationCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (_continue != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); + } + + if (gracePeriodSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); + } + + if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); + } + + if (labelSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (orphanDependents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); + } + + if (propagationPolicy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); + } + + if (resourceVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); + } + + if (resourceVersionMatch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); + } + + if (sendInitialEvents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); + } + + if (timeoutSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCollectionStorageVersionMigrationValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); + return localVarCall; + + } + + /** + * + * delete collection of StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @return V1Status + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1Status deleteCollectionStorageVersionMigration(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { + ApiResponse localVarResp = deleteCollectionStorageVersionMigrationWithHttpInfo(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); + return localVarResp.getData(); + } + + /** + * + * delete collection of StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @return ApiResponse<V1Status> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse deleteCollectionStorageVersionMigrationWithHttpInfo(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { + okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * delete collection of StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call deleteCollectionStorageVersionMigrationAsync(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteStorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call deleteStorageVersionMigrationCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (gracePeriodSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); + } + + if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); + } + + if (orphanDependents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); + } + + if (propagationPolicy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteStorageVersionMigrationValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteStorageVersionMigration(Async)"); + } + + + okhttp3.Call localVarCall = deleteStorageVersionMigrationCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); + return localVarCall; + + } + + /** + * + * delete a StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @return V1Status + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public V1Status deleteStorageVersionMigration(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { + ApiResponse localVarResp = deleteStorageVersionMigrationWithHttpInfo(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); + return localVarResp.getData(); + } + + /** + * + * delete a StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @return ApiResponse<V1Status> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public ApiResponse deleteStorageVersionMigrationWithHttpInfo(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { + okhttp3.Call localVarCall = deleteStorageVersionMigrationValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * delete a StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) + * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) + * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) + * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
+ */ + public okhttp3.Call deleteStorageVersionMigrationAsync(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteStorageVersionMigrationValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAPIResources + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getAPIResourcesCall(_callback); + return localVarCall; + + } + + /** + * + * get available resources + * @return V1APIResourceList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1APIResourceList getAPIResources() throws ApiException { + ApiResponse localVarResp = getAPIResourcesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * get available resources + * @return ApiResponse<V1APIResourceList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse getAPIResourcesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * get available resources + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call getAPIResourcesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listStorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call listStorageVersionMigrationCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (allowWatchBookmarks != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowWatchBookmarks", allowWatchBookmarks)); + } + + if (_continue != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); + } + + if (fieldSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); + } + + if (labelSelector != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (resourceVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); + } + + if (resourceVersionMatch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); + } + + if (sendInitialEvents != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); + } + + if (timeoutSeconds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); + } + + if (watch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch", "application/cbor-seq" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listStorageVersionMigrationValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = listStorageVersionMigrationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); + return localVarCall; + + } + + /** + * + * list or watch objects of kind StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @return V1alpha1StorageVersionMigrationList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigrationList listStorageVersionMigration(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { + ApiResponse localVarResp = listStorageVersionMigrationWithHttpInfo(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); + return localVarResp.getData(); + } + + /** + * + * list or watch objects of kind StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigrationList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse listStorageVersionMigrationWithHttpInfo(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { + okhttp3.Call localVarCall = listStorageVersionMigrationValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * list or watch objects of kind StorageVersionMigration + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) + * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) + * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) + * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) + * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) + * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) + * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) + * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) + * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call listStorageVersionMigrationAsync(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listStorageVersionMigrationValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for patchStorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchStorageVersionMigrationCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call patchStorageVersionMigrationValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling patchStorageVersionMigration(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling patchStorageVersionMigration(Async)"); + } + + + okhttp3.Call localVarCall = patchStorageVersionMigrationCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + return localVarCall; + + } + + /** + * + * partially update the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration patchStorageVersionMigration(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + ApiResponse localVarResp = patchStorageVersionMigrationWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + return localVarResp.getData(); + } + + /** + * + * partially update the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse patchStorageVersionMigrationWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + okhttp3.Call localVarCall = patchStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * partially update the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchStorageVersionMigrationAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = patchStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for patchStorageVersionMigrationStatus + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchStorageVersionMigrationStatusCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call patchStorageVersionMigrationStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling patchStorageVersionMigrationStatus(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling patchStorageVersionMigrationStatus(Async)"); + } + + + okhttp3.Call localVarCall = patchStorageVersionMigrationStatusCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + return localVarCall; + + } + + /** + * + * partially update status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration patchStorageVersionMigrationStatus(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + ApiResponse localVarResp = patchStorageVersionMigrationStatusWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); + return localVarResp.getData(); + } + + /** + * + * partially update status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse patchStorageVersionMigrationStatusWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { + okhttp3.Call localVarCall = patchStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * partially update status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call patchStorageVersionMigrationStatusAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = patchStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for readStorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readStorageVersionMigrationCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call readStorageVersionMigrationValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling readStorageVersionMigration(Async)"); + } + + + okhttp3.Call localVarCall = readStorageVersionMigrationCall(name, pretty, _callback); + return localVarCall; + + } + + /** + * + * read the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration readStorageVersionMigration(String name, String pretty) throws ApiException { + ApiResponse localVarResp = readStorageVersionMigrationWithHttpInfo(name, pretty); + return localVarResp.getData(); + } + + /** + * + * read the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse readStorageVersionMigrationWithHttpInfo(String name, String pretty) throws ApiException { + okhttp3.Call localVarCall = readStorageVersionMigrationValidateBeforeCall(name, pretty, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * read the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readStorageVersionMigrationAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = readStorageVersionMigrationValidateBeforeCall(name, pretty, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for readStorageVersionMigrationStatus + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readStorageVersionMigrationStatusCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call readStorageVersionMigrationStatusValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling readStorageVersionMigrationStatus(Async)"); + } + + + okhttp3.Call localVarCall = readStorageVersionMigrationStatusCall(name, pretty, _callback); + return localVarCall; + + } + + /** + * + * read status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration readStorageVersionMigrationStatus(String name, String pretty) throws ApiException { + ApiResponse localVarResp = readStorageVersionMigrationStatusWithHttpInfo(name, pretty); + return localVarResp.getData(); + } + + /** + * + * read status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public ApiResponse readStorageVersionMigrationStatusWithHttpInfo(String name, String pretty) throws ApiException { + okhttp3.Call localVarCall = readStorageVersionMigrationStatusValidateBeforeCall(name, pretty, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * read status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
401 Unauthorized -
+ */ + public okhttp3.Call readStorageVersionMigrationStatusAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = readStorageVersionMigrationStatusValidateBeforeCall(name, pretty, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceStorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceStorageVersionMigrationCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceStorageVersionMigrationValidateBeforeCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling replaceStorageVersionMigration(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling replaceStorageVersionMigration(Async)"); + } + + + okhttp3.Call localVarCall = replaceStorageVersionMigrationCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + return localVarCall; + + } + + /** + * + * replace the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration replaceStorageVersionMigration(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + ApiResponse localVarResp = replaceStorageVersionMigrationWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); + return localVarResp.getData(); + } + + /** + * + * replace the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse replaceStorageVersionMigrationWithHttpInfo(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + okhttp3.Call localVarCall = replaceStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * replace the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceStorageVersionMigrationAsync(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for replaceStorageVersionMigrationStatus + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceStorageVersionMigrationStatusCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" + .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pretty != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); + } + + if (dryRun != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); + } + + if (fieldManager != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); + } + + if (fieldValidation != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceStorageVersionMigrationStatusValidateBeforeCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling replaceStorageVersionMigrationStatus(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling replaceStorageVersionMigrationStatus(Async)"); + } + + + okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + return localVarCall; + + } + + /** + * + * replace status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return V1alpha1StorageVersionMigration + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public V1alpha1StorageVersionMigration replaceStorageVersionMigrationStatus(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + ApiResponse localVarResp = replaceStorageVersionMigrationStatusWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); + return localVarResp.getData(); + } + + /** + * + * replace status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @return ApiResponse<V1alpha1StorageVersionMigration> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public ApiResponse replaceStorageVersionMigrationStatusWithHttpInfo(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { + okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * replace status of the specified StorageVersionMigration + * @param name name of the StorageVersionMigration (required) + * @param body (required) + * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) + * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) + * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) + * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
+ */ + public okhttp3.Call replaceStorageVersionMigrationStatusAsync(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java new file mode 100644 index 0000000000..72053af81e --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java @@ -0,0 +1,156 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * The names of the group, the version, and the resource. + */ +@ApiModel(description = "The names of the group, the version, and the resource.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1GroupVersionResource { + public static final String SERIALIZED_NAME_GROUP = "group"; + @SerializedName(SERIALIZED_NAME_GROUP) + private String group; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + @SerializedName(SERIALIZED_NAME_RESOURCE) + private String resource; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + + public V1alpha1GroupVersionResource group(String group) { + + this.group = group; + return this; + } + + /** + * The name of the group. + * @return group + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the group.") + + public String getGroup() { + return group; + } + + + public void setGroup(String group) { + this.group = group; + } + + + public V1alpha1GroupVersionResource resource(String resource) { + + this.resource = resource; + return this; + } + + /** + * The name of the resource. + * @return resource + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the resource.") + + public String getResource() { + return resource; + } + + + public void setResource(String resource) { + this.resource = resource; + } + + + public V1alpha1GroupVersionResource version(String version) { + + this.version = version; + return this; + } + + /** + * The name of the version. + * @return version + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the version.") + + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1GroupVersionResource v1alpha1GroupVersionResource = (V1alpha1GroupVersionResource) o; + return Objects.equals(this.group, v1alpha1GroupVersionResource.group) && + Objects.equals(this.resource, v1alpha1GroupVersionResource.resource) && + Objects.equals(this.version, v1alpha1GroupVersionResource.version); + } + + @Override + public int hashCode() { + return Objects.hash(group, resource, version); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1GroupVersionResource {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java new file mode 100644 index 0000000000..9612daa46a --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java @@ -0,0 +1,213 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Describes the state of a migration at a certain point. + */ +@ApiModel(description = "Describes the state of a migration at a certain point.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1MigrationCondition { + public static final String SERIALIZED_NAME_LAST_UPDATE_TIME = "lastUpdateTime"; + @SerializedName(SERIALIZED_NAME_LAST_UPDATE_TIME) + private OffsetDateTime lastUpdateTime; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + + public V1alpha1MigrationCondition lastUpdateTime(OffsetDateTime lastUpdateTime) { + + this.lastUpdateTime = lastUpdateTime; + return this; + } + + /** + * The last time this condition was updated. + * @return lastUpdateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The last time this condition was updated.") + + public OffsetDateTime getLastUpdateTime() { + return lastUpdateTime; + } + + + public void setLastUpdateTime(OffsetDateTime lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + + public V1alpha1MigrationCondition message(String message) { + + this.message = message; + return this; + } + + /** + * A human readable message indicating details about the transition. + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A human readable message indicating details about the transition.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public V1alpha1MigrationCondition reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * The reason for the condition's last transition. + * @return reason + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The reason for the condition's last transition.") + + public String getReason() { + return reason; + } + + + public void setReason(String reason) { + this.reason = reason; + } + + + public V1alpha1MigrationCondition status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the condition, one of True, False, Unknown. + * @return status + **/ + @ApiModelProperty(required = true, value = "Status of the condition, one of True, False, Unknown.") + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public V1alpha1MigrationCondition type(String type) { + + this.type = type; + return this; + } + + /** + * Type of the condition. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of the condition.") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1MigrationCondition v1alpha1MigrationCondition = (V1alpha1MigrationCondition) o; + return Objects.equals(this.lastUpdateTime, v1alpha1MigrationCondition.lastUpdateTime) && + Objects.equals(this.message, v1alpha1MigrationCondition.message) && + Objects.equals(this.reason, v1alpha1MigrationCondition.reason) && + Objects.equals(this.status, v1alpha1MigrationCondition.status) && + Objects.equals(this.type, v1alpha1MigrationCondition.type); + } + + @Override + public int hashCode() { + return Objects.hash(lastUpdateTime, message, reason, status, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1MigrationCondition {\n"); + sb.append(" lastUpdateTime: ").append(toIndentedString(lastUpdateTime)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java new file mode 100644 index 0000000000..94bf17faf6 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java @@ -0,0 +1,216 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequestSpec; +import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequestStatus; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes + */ +@ApiModel(description = "PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1PodCertificateRequest implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha1PodCertificateRequestSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha1PodCertificateRequestStatus status; + + + public V1alpha1PodCertificateRequest apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1PodCertificateRequest kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1PodCertificateRequest metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ObjectMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + + public V1alpha1PodCertificateRequest spec(V1alpha1PodCertificateRequestSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * @return spec + **/ + @ApiModelProperty(required = true, value = "") + + public V1alpha1PodCertificateRequestSpec getSpec() { + return spec; + } + + + public void setSpec(V1alpha1PodCertificateRequestSpec spec) { + this.spec = spec; + } + + + public V1alpha1PodCertificateRequest status(V1alpha1PodCertificateRequestStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha1PodCertificateRequestStatus getStatus() { + return status; + } + + + public void setStatus(V1alpha1PodCertificateRequestStatus status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1PodCertificateRequest v1alpha1PodCertificateRequest = (V1alpha1PodCertificateRequest) o; + return Objects.equals(this.apiVersion, v1alpha1PodCertificateRequest.apiVersion) && + Objects.equals(this.kind, v1alpha1PodCertificateRequest.kind) && + Objects.equals(this.metadata, v1alpha1PodCertificateRequest.metadata) && + Objects.equals(this.spec, v1alpha1PodCertificateRequest.spec) && + Objects.equals(this.status, v1alpha1PodCertificateRequest.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1PodCertificateRequest {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java new file mode 100644 index 0000000000..a2356e3f62 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java @@ -0,0 +1,193 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * PodCertificateRequestList is a collection of PodCertificateRequest objects + */ +@ApiModel(description = "PodCertificateRequestList is a collection of PodCertificateRequest objects") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1PodCertificateRequestList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata; + + + public V1alpha1PodCertificateRequestList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1PodCertificateRequestList items(List items) { + + this.items = items; + return this; + } + + public V1alpha1PodCertificateRequestList addItemsItem(V1alpha1PodCertificateRequest itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * items is a collection of PodCertificateRequest objects + * @return items + **/ + @ApiModelProperty(required = true, value = "items is a collection of PodCertificateRequest objects") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + public V1alpha1PodCertificateRequestList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1PodCertificateRequestList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ListMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1PodCertificateRequestList v1alpha1PodCertificateRequestList = (V1alpha1PodCertificateRequestList) o; + return Objects.equals(this.apiVersion, v1alpha1PodCertificateRequestList.apiVersion) && + Objects.equals(this.items, v1alpha1PodCertificateRequestList.items) && + Objects.equals(this.kind, v1alpha1PodCertificateRequestList.kind) && + Objects.equals(this.metadata, v1alpha1PodCertificateRequestList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1PodCertificateRequestList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java new file mode 100644 index 0000000000..a294e70ebf --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java @@ -0,0 +1,350 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. + */ +@ApiModel(description = "PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1PodCertificateRequestSpec { + public static final String SERIALIZED_NAME_MAX_EXPIRATION_SECONDS = "maxExpirationSeconds"; + @SerializedName(SERIALIZED_NAME_MAX_EXPIRATION_SECONDS) + private Integer maxExpirationSeconds; + + public static final String SERIALIZED_NAME_NODE_NAME = "nodeName"; + @SerializedName(SERIALIZED_NAME_NODE_NAME) + private String nodeName; + + public static final String SERIALIZED_NAME_NODE_U_I_D = "nodeUID"; + @SerializedName(SERIALIZED_NAME_NODE_U_I_D) + private String nodeUID; + + public static final String SERIALIZED_NAME_PKIX_PUBLIC_KEY = "pkixPublicKey"; + @SerializedName(SERIALIZED_NAME_PKIX_PUBLIC_KEY) + private byte[] pkixPublicKey; + + public static final String SERIALIZED_NAME_POD_NAME = "podName"; + @SerializedName(SERIALIZED_NAME_POD_NAME) + private String podName; + + public static final String SERIALIZED_NAME_POD_U_I_D = "podUID"; + @SerializedName(SERIALIZED_NAME_POD_U_I_D) + private String podUID; + + public static final String SERIALIZED_NAME_PROOF_OF_POSSESSION = "proofOfPossession"; + @SerializedName(SERIALIZED_NAME_PROOF_OF_POSSESSION) + private byte[] proofOfPossession; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_NAME = "serviceAccountName"; + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_NAME) + private String serviceAccountName; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_U_I_D = "serviceAccountUID"; + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_U_I_D) + private String serviceAccountUID; + + public static final String SERIALIZED_NAME_SIGNER_NAME = "signerName"; + @SerializedName(SERIALIZED_NAME_SIGNER_NAME) + private String signerName; + + + public V1alpha1PodCertificateRequestSpec maxExpirationSeconds(Integer maxExpirationSeconds) { + + this.maxExpirationSeconds = maxExpirationSeconds; + return this; + } + + /** + * maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. + * @return maxExpirationSeconds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.") + + public Integer getMaxExpirationSeconds() { + return maxExpirationSeconds; + } + + + public void setMaxExpirationSeconds(Integer maxExpirationSeconds) { + this.maxExpirationSeconds = maxExpirationSeconds; + } + + + public V1alpha1PodCertificateRequestSpec nodeName(String nodeName) { + + this.nodeName = nodeName; + return this; + } + + /** + * nodeName is the name of the node the pod is assigned to. + * @return nodeName + **/ + @ApiModelProperty(required = true, value = "nodeName is the name of the node the pod is assigned to.") + + public String getNodeName() { + return nodeName; + } + + + public void setNodeName(String nodeName) { + this.nodeName = nodeName; + } + + + public V1alpha1PodCertificateRequestSpec nodeUID(String nodeUID) { + + this.nodeUID = nodeUID; + return this; + } + + /** + * nodeUID is the UID of the node the pod is assigned to. + * @return nodeUID + **/ + @ApiModelProperty(required = true, value = "nodeUID is the UID of the node the pod is assigned to.") + + public String getNodeUID() { + return nodeUID; + } + + + public void setNodeUID(String nodeUID) { + this.nodeUID = nodeUID; + } + + + public V1alpha1PodCertificateRequestSpec pkixPublicKey(byte[] pkixPublicKey) { + + this.pkixPublicKey = pkixPublicKey; + return this; + } + + /** + * pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field. + * @return pkixPublicKey + **/ + @ApiModelProperty(required = true, value = "pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field.") + + public byte[] getPkixPublicKey() { + return pkixPublicKey; + } + + + public void setPkixPublicKey(byte[] pkixPublicKey) { + this.pkixPublicKey = pkixPublicKey; + } + + + public V1alpha1PodCertificateRequestSpec podName(String podName) { + + this.podName = podName; + return this; + } + + /** + * podName is the name of the pod into which the certificate will be mounted. + * @return podName + **/ + @ApiModelProperty(required = true, value = "podName is the name of the pod into which the certificate will be mounted.") + + public String getPodName() { + return podName; + } + + + public void setPodName(String podName) { + this.podName = podName; + } + + + public V1alpha1PodCertificateRequestSpec podUID(String podUID) { + + this.podUID = podUID; + return this; + } + + /** + * podUID is the UID of the pod into which the certificate will be mounted. + * @return podUID + **/ + @ApiModelProperty(required = true, value = "podUID is the UID of the pod into which the certificate will be mounted.") + + public String getPodUID() { + return podUID; + } + + + public void setPodUID(String podUID) { + this.podUID = podUID; + } + + + public V1alpha1PodCertificateRequestSpec proofOfPossession(byte[] proofOfPossession) { + + this.proofOfPossession = proofOfPossession; + return this; + } + + /** + * proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign). + * @return proofOfPossession + **/ + @ApiModelProperty(required = true, value = "proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign).") + + public byte[] getProofOfPossession() { + return proofOfPossession; + } + + + public void setProofOfPossession(byte[] proofOfPossession) { + this.proofOfPossession = proofOfPossession; + } + + + public V1alpha1PodCertificateRequestSpec serviceAccountName(String serviceAccountName) { + + this.serviceAccountName = serviceAccountName; + return this; + } + + /** + * serviceAccountName is the name of the service account the pod is running as. + * @return serviceAccountName + **/ + @ApiModelProperty(required = true, value = "serviceAccountName is the name of the service account the pod is running as.") + + public String getServiceAccountName() { + return serviceAccountName; + } + + + public void setServiceAccountName(String serviceAccountName) { + this.serviceAccountName = serviceAccountName; + } + + + public V1alpha1PodCertificateRequestSpec serviceAccountUID(String serviceAccountUID) { + + this.serviceAccountUID = serviceAccountUID; + return this; + } + + /** + * serviceAccountUID is the UID of the service account the pod is running as. + * @return serviceAccountUID + **/ + @ApiModelProperty(required = true, value = "serviceAccountUID is the UID of the service account the pod is running as.") + + public String getServiceAccountUID() { + return serviceAccountUID; + } + + + public void setServiceAccountUID(String serviceAccountUID) { + this.serviceAccountUID = serviceAccountUID; + } + + + public V1alpha1PodCertificateRequestSpec signerName(String signerName) { + + this.signerName = signerName; + return this; + } + + /** + * signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented. + * @return signerName + **/ + @ApiModelProperty(required = true, value = "signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented.") + + public String getSignerName() { + return signerName; + } + + + public void setSignerName(String signerName) { + this.signerName = signerName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1PodCertificateRequestSpec v1alpha1PodCertificateRequestSpec = (V1alpha1PodCertificateRequestSpec) o; + return Objects.equals(this.maxExpirationSeconds, v1alpha1PodCertificateRequestSpec.maxExpirationSeconds) && + Objects.equals(this.nodeName, v1alpha1PodCertificateRequestSpec.nodeName) && + Objects.equals(this.nodeUID, v1alpha1PodCertificateRequestSpec.nodeUID) && + Arrays.equals(this.pkixPublicKey, v1alpha1PodCertificateRequestSpec.pkixPublicKey) && + Objects.equals(this.podName, v1alpha1PodCertificateRequestSpec.podName) && + Objects.equals(this.podUID, v1alpha1PodCertificateRequestSpec.podUID) && + Arrays.equals(this.proofOfPossession, v1alpha1PodCertificateRequestSpec.proofOfPossession) && + Objects.equals(this.serviceAccountName, v1alpha1PodCertificateRequestSpec.serviceAccountName) && + Objects.equals(this.serviceAccountUID, v1alpha1PodCertificateRequestSpec.serviceAccountUID) && + Objects.equals(this.signerName, v1alpha1PodCertificateRequestSpec.signerName); + } + + @Override + public int hashCode() { + return Objects.hash(maxExpirationSeconds, nodeName, nodeUID, Arrays.hashCode(pkixPublicKey), podName, podUID, Arrays.hashCode(proofOfPossession), serviceAccountName, serviceAccountUID, signerName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1PodCertificateRequestSpec {\n"); + sb.append(" maxExpirationSeconds: ").append(toIndentedString(maxExpirationSeconds)).append("\n"); + sb.append(" nodeName: ").append(toIndentedString(nodeName)).append("\n"); + sb.append(" nodeUID: ").append(toIndentedString(nodeUID)).append("\n"); + sb.append(" pkixPublicKey: ").append(toIndentedString(pkixPublicKey)).append("\n"); + sb.append(" podName: ").append(toIndentedString(podName)).append("\n"); + sb.append(" podUID: ").append(toIndentedString(podUID)).append("\n"); + sb.append(" proofOfPossession: ").append(toIndentedString(proofOfPossession)).append("\n"); + sb.append(" serviceAccountName: ").append(toIndentedString(serviceAccountName)).append("\n"); + sb.append(" serviceAccountUID: ").append(toIndentedString(serviceAccountUID)).append("\n"); + sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java new file mode 100644 index 0000000000..7d457b9356 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java @@ -0,0 +1,226 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1Condition; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. + */ +@ApiModel(description = "PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1PodCertificateRequestStatus { + public static final String SERIALIZED_NAME_BEGIN_REFRESH_AT = "beginRefreshAt"; + @SerializedName(SERIALIZED_NAME_BEGIN_REFRESH_AT) + private OffsetDateTime beginRefreshAt; + + public static final String SERIALIZED_NAME_CERTIFICATE_CHAIN = "certificateChain"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE_CHAIN) + private String certificateChain; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public static final String SERIALIZED_NAME_NOT_AFTER = "notAfter"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER) + private OffsetDateTime notAfter; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "notBefore"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + private OffsetDateTime notBefore; + + + public V1alpha1PodCertificateRequestStatus beginRefreshAt(OffsetDateTime beginRefreshAt) { + + this.beginRefreshAt = beginRefreshAt; + return this; + } + + /** + * beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary. + * @return beginRefreshAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary.") + + public OffsetDateTime getBeginRefreshAt() { + return beginRefreshAt; + } + + + public void setBeginRefreshAt(OffsetDateTime beginRefreshAt) { + this.beginRefreshAt = beginRefreshAt; + } + + + public V1alpha1PodCertificateRequestStatus certificateChain(String certificateChain) { + + this.certificateChain = certificateChain; + return this; + } + + /** + * certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers. + * @return certificateChain + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.") + + public String getCertificateChain() { + return certificateChain; + } + + + public void setCertificateChain(String certificateChain) { + this.certificateChain = certificateChain; + } + + + public V1alpha1PodCertificateRequestStatus conditions(List conditions) { + + this.conditions = conditions; + return this; + } + + public V1alpha1PodCertificateRequestStatus addConditionsItem(V1Condition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field. + * @return conditions + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.") + + public List getConditions() { + return conditions; + } + + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + + public V1alpha1PodCertificateRequestStatus notAfter(OffsetDateTime notAfter) { + + this.notAfter = notAfter; + return this; + } + + /** + * notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. + * @return notAfter + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.") + + public OffsetDateTime getNotAfter() { + return notAfter; + } + + + public void setNotAfter(OffsetDateTime notAfter) { + this.notAfter = notAfter; + } + + + public V1alpha1PodCertificateRequestStatus notBefore(OffsetDateTime notBefore) { + + this.notBefore = notBefore; + return this; + } + + /** + * notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. + * @return notBefore + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.") + + public OffsetDateTime getNotBefore() { + return notBefore; + } + + + public void setNotBefore(OffsetDateTime notBefore) { + this.notBefore = notBefore; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1PodCertificateRequestStatus v1alpha1PodCertificateRequestStatus = (V1alpha1PodCertificateRequestStatus) o; + return Objects.equals(this.beginRefreshAt, v1alpha1PodCertificateRequestStatus.beginRefreshAt) && + Objects.equals(this.certificateChain, v1alpha1PodCertificateRequestStatus.certificateChain) && + Objects.equals(this.conditions, v1alpha1PodCertificateRequestStatus.conditions) && + Objects.equals(this.notAfter, v1alpha1PodCertificateRequestStatus.notAfter) && + Objects.equals(this.notBefore, v1alpha1PodCertificateRequestStatus.notBefore); + } + + @Override + public int hashCode() { + return Objects.hash(beginRefreshAt, certificateChain, conditions, notAfter, notBefore); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1PodCertificateRequestStatus {\n"); + sb.append(" beginRefreshAt: ").append(toIndentedString(beginRefreshAt)).append("\n"); + sb.append(" certificateChain: ").append(toIndentedString(certificateChain)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" notAfter: ").append(toIndentedString(notAfter)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java new file mode 100644 index 0000000000..11cba244cd --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java @@ -0,0 +1,217 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationSpec; +import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationStatus; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * StorageVersionMigration represents a migration of stored data to the latest storage version. + */ +@ApiModel(description = "StorageVersionMigration represents a migration of stored data to the latest storage version.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1StorageVersionMigration implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha1StorageVersionMigrationSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha1StorageVersionMigrationStatus status; + + + public V1alpha1StorageVersionMigration apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1StorageVersionMigration kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1StorageVersionMigration metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ObjectMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + + public V1alpha1StorageVersionMigration spec(V1alpha1StorageVersionMigrationSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * @return spec + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha1StorageVersionMigrationSpec getSpec() { + return spec; + } + + + public void setSpec(V1alpha1StorageVersionMigrationSpec spec) { + this.spec = spec; + } + + + public V1alpha1StorageVersionMigration status(V1alpha1StorageVersionMigrationStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha1StorageVersionMigrationStatus getStatus() { + return status; + } + + + public void setStatus(V1alpha1StorageVersionMigrationStatus status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1StorageVersionMigration v1alpha1StorageVersionMigration = (V1alpha1StorageVersionMigration) o; + return Objects.equals(this.apiVersion, v1alpha1StorageVersionMigration.apiVersion) && + Objects.equals(this.kind, v1alpha1StorageVersionMigration.kind) && + Objects.equals(this.metadata, v1alpha1StorageVersionMigration.metadata) && + Objects.equals(this.spec, v1alpha1StorageVersionMigration.spec) && + Objects.equals(this.status, v1alpha1StorageVersionMigration.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1StorageVersionMigration {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java new file mode 100644 index 0000000000..35dc5a72c9 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java @@ -0,0 +1,193 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigration; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * StorageVersionMigrationList is a collection of storage version migrations. + */ +@ApiModel(description = "StorageVersionMigrationList is a collection of storage version migrations.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1StorageVersionMigrationList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata; + + + public V1alpha1StorageVersionMigrationList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1StorageVersionMigrationList items(List items) { + + this.items = items; + return this; + } + + public V1alpha1StorageVersionMigrationList addItemsItem(V1alpha1StorageVersionMigration itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * Items is the list of StorageVersionMigration + * @return items + **/ + @ApiModelProperty(required = true, value = "Items is the list of StorageVersionMigration") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + public V1alpha1StorageVersionMigrationList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1StorageVersionMigrationList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ListMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1StorageVersionMigrationList v1alpha1StorageVersionMigrationList = (V1alpha1StorageVersionMigrationList) o; + return Objects.equals(this.apiVersion, v1alpha1StorageVersionMigrationList.apiVersion) && + Objects.equals(this.items, v1alpha1StorageVersionMigrationList.items) && + Objects.equals(this.kind, v1alpha1StorageVersionMigrationList.kind) && + Objects.equals(this.metadata, v1alpha1StorageVersionMigrationList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1StorageVersionMigrationList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java new file mode 100644 index 0000000000..df4b271e01 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java @@ -0,0 +1,127 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1alpha1GroupVersionResource; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Spec of the storage version migration. + */ +@ApiModel(description = "Spec of the storage version migration.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1StorageVersionMigrationSpec { + public static final String SERIALIZED_NAME_CONTINUE_TOKEN = "continueToken"; + @SerializedName(SERIALIZED_NAME_CONTINUE_TOKEN) + private String continueToken; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + @SerializedName(SERIALIZED_NAME_RESOURCE) + private V1alpha1GroupVersionResource resource; + + + public V1alpha1StorageVersionMigrationSpec continueToken(String continueToken) { + + this.continueToken = continueToken; + return this; + } + + /** + * The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration. + * @return continueToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration.") + + public String getContinueToken() { + return continueToken; + } + + + public void setContinueToken(String continueToken) { + this.continueToken = continueToken; + } + + + public V1alpha1StorageVersionMigrationSpec resource(V1alpha1GroupVersionResource resource) { + + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(required = true, value = "") + + public V1alpha1GroupVersionResource getResource() { + return resource; + } + + + public void setResource(V1alpha1GroupVersionResource resource) { + this.resource = resource; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1StorageVersionMigrationSpec v1alpha1StorageVersionMigrationSpec = (V1alpha1StorageVersionMigrationSpec) o; + return Objects.equals(this.continueToken, v1alpha1StorageVersionMigrationSpec.continueToken) && + Objects.equals(this.resource, v1alpha1StorageVersionMigrationSpec.resource); + } + + @Override + public int hashCode() { + return Objects.hash(continueToken, resource); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1StorageVersionMigrationSpec {\n"); + sb.append(" continueToken: ").append(toIndentedString(continueToken)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java new file mode 100644 index 0000000000..7f8b645964 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java @@ -0,0 +1,138 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1alpha1MigrationCondition; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Status of the storage version migration. + */ +@ApiModel(description = "Status of the storage version migration.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1StorageVersionMigrationStatus { + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + private List conditions = null; + + public static final String SERIALIZED_NAME_RESOURCE_VERSION = "resourceVersion"; + @SerializedName(SERIALIZED_NAME_RESOURCE_VERSION) + private String resourceVersion; + + + public V1alpha1StorageVersionMigrationStatus conditions(List conditions) { + + this.conditions = conditions; + return this; + } + + public V1alpha1StorageVersionMigrationStatus addConditionsItem(V1alpha1MigrationCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * The latest available observations of the migration's current state. + * @return conditions + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The latest available observations of the migration's current state.") + + public List getConditions() { + return conditions; + } + + + public void setConditions(List conditions) { + this.conditions = conditions; + } + + + public V1alpha1StorageVersionMigrationStatus resourceVersion(String resourceVersion) { + + this.resourceVersion = resourceVersion; + return this; + } + + /** + * ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource. + * @return resourceVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource.") + + public String getResourceVersion() { + return resourceVersion; + } + + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1StorageVersionMigrationStatus v1alpha1StorageVersionMigrationStatus = (V1alpha1StorageVersionMigrationStatus) o; + return Objects.equals(this.conditions, v1alpha1StorageVersionMigrationStatus.conditions) && + Objects.equals(this.resourceVersion, v1alpha1StorageVersionMigrationStatus.resourceVersion); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, resourceVersion); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1StorageVersionMigrationStatus {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" resourceVersion: ").append(toIndentedString(resourceVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java new file mode 100644 index 0000000000..3753c29a20 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java @@ -0,0 +1,225 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. + */ +@ApiModel(description = "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1VolumeAttributesClass implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_DRIVER_NAME = "driverName"; + @SerializedName(SERIALIZED_NAME_DRIVER_NAME) + private String driverName; + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata; + + public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; + @SerializedName(SERIALIZED_NAME_PARAMETERS) + private Map parameters = null; + + + public V1alpha1VolumeAttributesClass apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1VolumeAttributesClass driverName(String driverName) { + + this.driverName = driverName; + return this; + } + + /** + * Name of the CSI driver This field is immutable. + * @return driverName + **/ + @ApiModelProperty(required = true, value = "Name of the CSI driver This field is immutable.") + + public String getDriverName() { + return driverName; + } + + + public void setDriverName(String driverName) { + this.driverName = driverName; + } + + + public V1alpha1VolumeAttributesClass kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1VolumeAttributesClass metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ObjectMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + + public V1alpha1VolumeAttributesClass parameters(Map parameters) { + + this.parameters = parameters; + return this; + } + + public V1alpha1VolumeAttributesClass putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. + * @return parameters + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.") + + public Map getParameters() { + return parameters; + } + + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1VolumeAttributesClass v1alpha1VolumeAttributesClass = (V1alpha1VolumeAttributesClass) o; + return Objects.equals(this.apiVersion, v1alpha1VolumeAttributesClass.apiVersion) && + Objects.equals(this.driverName, v1alpha1VolumeAttributesClass.driverName) && + Objects.equals(this.kind, v1alpha1VolumeAttributesClass.kind) && + Objects.equals(this.metadata, v1alpha1VolumeAttributesClass.metadata) && + Objects.equals(this.parameters, v1alpha1VolumeAttributesClass.parameters); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, driverName, kind, metadata, parameters); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1VolumeAttributesClass {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" driverName: ").append(toIndentedString(driverName)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java new file mode 100644 index 0000000000..2f4a4bc1f3 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java @@ -0,0 +1,193 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClass; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * VolumeAttributesClassList is a collection of VolumeAttributesClass objects. + */ +@ApiModel(description = "VolumeAttributesClassList is a collection of VolumeAttributesClass objects.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha1VolumeAttributesClassList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata; + + + public V1alpha1VolumeAttributesClassList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1VolumeAttributesClassList items(List items) { + + this.items = items; + return this; + } + + public V1alpha1VolumeAttributesClassList addItemsItem(V1alpha1VolumeAttributesClass itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * items is the list of VolumeAttributesClass objects. + * @return items + **/ + @ApiModelProperty(required = true, value = "items is the list of VolumeAttributesClass objects.") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + public V1alpha1VolumeAttributesClassList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1VolumeAttributesClassList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ListMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1VolumeAttributesClassList v1alpha1VolumeAttributesClassList = (V1alpha1VolumeAttributesClassList) o; + return Objects.equals(this.apiVersion, v1alpha1VolumeAttributesClassList.apiVersion) && + Objects.equals(this.items, v1alpha1VolumeAttributesClassList.items) && + Objects.equals(this.kind, v1alpha1VolumeAttributesClassList.kind) && + Objects.equals(this.metadata, v1alpha1VolumeAttributesClassList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1VolumeAttributesClassList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java new file mode 100644 index 0000000000..f337530d03 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java @@ -0,0 +1,97 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * CELDeviceSelector contains a CEL expression for selecting a device. + */ +@ApiModel(description = "CELDeviceSelector contains a CEL expression for selecting a device.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha3CELDeviceSelector { + public static final String SERIALIZED_NAME_EXPRESSION = "expression"; + @SerializedName(SERIALIZED_NAME_EXPRESSION) + private String expression; + + + public V1alpha3CELDeviceSelector expression(String expression) { + + this.expression = expression; + return this; + } + + /** + * Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. + * @return expression + **/ + @ApiModelProperty(required = true, value = "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.") + + public String getExpression() { + return expression; + } + + + public void setExpression(String expression) { + this.expression = expression; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3CELDeviceSelector v1alpha3CELDeviceSelector = (V1alpha3CELDeviceSelector) o; + return Objects.equals(this.expression, v1alpha3CELDeviceSelector.expression); + } + + @Override + public int hashCode() { + return Objects.hash(expression); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3CELDeviceSelector {\n"); + sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java new file mode 100644 index 0000000000..6481d96973 --- /dev/null +++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java @@ -0,0 +1,99 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.openapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.kubernetes.client.openapi.models.V1alpha3CELDeviceSelector; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DeviceSelector must have exactly one field set. + */ +@ApiModel(description = "DeviceSelector must have exactly one field set.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") +public class V1alpha3DeviceSelector { + public static final String SERIALIZED_NAME_CEL = "cel"; + @SerializedName(SERIALIZED_NAME_CEL) + private V1alpha3CELDeviceSelector cel; + + + public V1alpha3DeviceSelector cel(V1alpha3CELDeviceSelector cel) { + + this.cel = cel; + return this; + } + + /** + * Get cel + * @return cel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha3CELDeviceSelector getCel() { + return cel; + } + + + public void setCel(V1alpha3CELDeviceSelector cel) { + this.cel = cel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha3DeviceSelector v1alpha3DeviceSelector = (V1alpha3DeviceSelector) o; + return Objects.equals(this.cel, v1alpha3DeviceSelector.cel); + } + + @Override + public int hashCode() { + return Objects.hash(cel); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha3DeviceSelector {\n"); + sb.append(" cel: ").append(toIndentedString(cel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java new file mode 100644 index 0000000000..d6b3d5d1b7 --- /dev/null +++ b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java @@ -0,0 +1,5194 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.proto; + +public final class V1alpha1Admission { + private V1alpha1Admission() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface AdmissionReviewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReview) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *

+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + boolean hasSpec(); + /** + * + * + *
+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec(); + /** + * + * + *
+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + boolean hasStatus(); + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus(); + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder + getStatusOrBuilder(); + } + /** + * + * + *
+   * AdmissionReview describes an admission request.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReview} + */ + public static final class AdmissionReview extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReview) + AdmissionReviewOrBuilder { + private static final long serialVersionUID = 0L; + // Use AdmissionReview.newBuilder() to construct. + private AdmissionReview(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AdmissionReview() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AdmissionReview( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder + subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = spec_.toBuilder(); + } + spec_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spec_); + spec_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder + subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = status_.toBuilder(); + } + status_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.Builder.class); + } + + private int bitField0_; + public static final int SPEC_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec spec_; + /** + * + * + *
+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec() { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.getDefaultInstance() + : spec_; + } + /** + * + * + *
+     * Spec describes the attributes for the admission request.
+     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+     * cost of deserializing it.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder + getSpecOrBuilder() { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.getDefaultInstance() + : spec_; + } + + public static final int STATUS_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus status_; + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus() { + return status_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.getDefaultInstance() + : status_; + } + /** + * + * + *
+     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+     * +optional
+     * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder + getStatusOrBuilder() { + return status_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.getDefaultInstance() + : status_; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getSpec()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getStatus()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSpec()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview other = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) obj; + + boolean result = true; + result = result && (hasSpec() == other.hasSpec()); + if (hasSpec()) { + result = result && getSpec().equals(other.getSpec()); + } + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && getStatus().equals(other.getStatus()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * AdmissionReview describes an admission request.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReview} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReview) + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpecFieldBuilder(); + getStatusFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (specBuilder_ == null) { + spec_ = null; + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (statusBuilder_ == null) { + status_ = null; + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview build() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview buildPartial() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview result = + new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (specBuilder_ == null) { + result.spec_ = spec_; + } else { + result.spec_ = specBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) { + return mergeFrom((io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.getDefaultInstance()) + return this; + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec spec_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder> + specBuilder_; + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + .getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public Builder setSpec( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public Builder setSpec( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder + builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public Builder mergeSpec( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && spec_ != null + && spec_ + != io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + .getDefaultInstance()) { + spec_ = + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.newBuilder(spec_) + .mergeFrom(value) + .buildPartial(); + } else { + spec_ = value; + } + onChanged(); + } else { + specBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + spec_ = null; + onChanged(); + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder + getSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder + getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + .getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+       * Spec describes the attributes for the admission request.
+       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
+       * cost of deserializing it.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus status_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + .getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public Builder setStatus( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public Builder setStatus( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder + builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public Builder mergeStatus( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && status_ != null + && status_ + != io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + .getDefaultInstance()) { + status_ = + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.newBuilder( + status_) + .mergeFrom(value) + .buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder + getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder + getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + .getDefaultInstance() + : status_; + } + } + /** + * + * + *
+       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
+       * +optional
+       * 
+ * + * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReview) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReview) + private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview(); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AdmissionReview parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AdmissionReview(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AdmissionReviewSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + boolean hasKind(); + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + io.kubernetes.client.proto.Meta.GroupVersionKind getKind(); + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder(); + + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + boolean hasObject(); + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + io.kubernetes.client.proto.Runtime.RawExtension getObject(); + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder(); + + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + boolean hasOldObject(); + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + io.kubernetes.client.proto.Runtime.RawExtension getOldObject(); + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder(); + + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + boolean hasOperation(); + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + java.lang.String getOperation(); + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + com.google.protobuf.ByteString getOperationBytes(); + + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + boolean hasName(); + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + java.lang.String getName(); + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + boolean hasNamespace(); + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + java.lang.String getNamespace(); + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + com.google.protobuf.ByteString getNamespaceBytes(); + + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + boolean hasResource(); + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + io.kubernetes.client.proto.Meta.GroupVersionResource getResource(); + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + boolean hasSubResource(); + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + java.lang.String getSubResource(); + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + com.google.protobuf.ByteString getSubResourceBytes(); + + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + boolean hasUserInfo(); + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo(); + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder(); + } + /** + * + * + *
+   * AdmissionReviewSpec describes the admission.Attributes for the admission request.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewSpec} + */ + public static final class AdmissionReviewSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) + AdmissionReviewSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use AdmissionReviewSpec.newBuilder() to construct. + private AdmissionReviewSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AdmissionReviewSpec() { + operation_ = ""; + name_ = ""; + namespace_ = ""; + subResource_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AdmissionReviewSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.Meta.GroupVersionKind.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = kind_.toBuilder(); + } + kind_ = + input.readMessage( + io.kubernetes.client.proto.Meta.GroupVersionKind.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kind_); + kind_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.Runtime.RawExtension.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = object_.toBuilder(); + } + object_ = + input.readMessage( + io.kubernetes.client.proto.Runtime.RawExtension.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(object_); + object_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: + { + io.kubernetes.client.proto.Runtime.RawExtension.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = oldObject_.toBuilder(); + } + oldObject_ = + input.readMessage( + io.kubernetes.client.proto.Runtime.RawExtension.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(oldObject_); + oldObject_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + operation_ = bs; + break; + } + case 42: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + name_ = bs; + break; + } + case 50: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + namespace_ = bs; + break; + } + case 58: + { + io.kubernetes.client.proto.Meta.GroupVersionResource.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + subBuilder = resource_.toBuilder(); + } + resource_ = + input.readMessage( + io.kubernetes.client.proto.Meta.GroupVersionResource.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 66: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000080; + subResource_ = bs; + break; + } + case 74: + { + io.kubernetes.client.proto.V1Authentication.UserInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + io.kubernetes.client.proto.V1Authentication.UserInfo.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder.class); + } + + private int bitField0_; + public static final int KIND_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.GroupVersionKind kind_; + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + public boolean hasKind() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + public io.kubernetes.client.proto.Meta.GroupVersionKind getKind() { + return kind_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() + : kind_; + } + /** + * + * + *
+     * Kind is the type of object being manipulated.  For example: Pod
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + */ + public io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder() { + return kind_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() + : kind_; + } + + public static final int OBJECT_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.Runtime.RawExtension object_; + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public boolean hasObject() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public io.kubernetes.client.proto.Runtime.RawExtension getObject() { + return object_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : object_; + } + /** + * + * + *
+     * Object is the object from the incoming request prior to default values being applied
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder() { + return object_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : object_; + } + + public static final int OLDOBJECT_FIELD_NUMBER = 3; + private io.kubernetes.client.proto.Runtime.RawExtension oldObject_; + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public boolean hasOldObject() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public io.kubernetes.client.proto.Runtime.RawExtension getOldObject() { + return oldObject_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : oldObject_; + } + /** + * + * + *
+     * OldObject is the existing object. Only populated for UPDATE requests.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder() { + return oldObject_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : oldObject_; + } + + public static final int OPERATION_FIELD_NUMBER = 4; + private volatile java.lang.Object operation_; + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + operation_ = s; + } + return s; + } + } + /** + * + * + *
+     * Operation is the operation being performed
+     * 
+ * + * optional string operation = 4; + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+     * +optional
+     * 
+ * + * optional string name = 5; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAMESPACE_FIELD_NUMBER = 6; + private volatile java.lang.Object namespace_; + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } + } + /** + * + * + *
+     * Namespace is the namespace associated with the request (if any).
+     * +optional
+     * 
+ * + * optional string namespace = 6; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 7; + private io.kubernetes.client.proto.Meta.GroupVersionResource resource_; + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionResource getResource() { + return resource_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() + : resource_; + } + /** + * + * + *
+     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder() { + return resource_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() + : resource_; + } + + public static final int SUBRESOURCE_FIELD_NUMBER = 8; + private volatile java.lang.Object subResource_; + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + public boolean hasSubResource() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + public java.lang.String getSubResource() { + java.lang.Object ref = subResource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + subResource_ = s; + } + return s; + } + } + /** + * + * + *
+     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+     * "binding", and kind "Binding".
+     * +optional
+     * 
+ * + * optional string subResource = 8; + */ + public com.google.protobuf.ByteString getSubResourceBytes() { + java.lang.Object ref = subResource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERINFO_FIELD_NUMBER = 9; + private io.kubernetes.client.proto.V1Authentication.UserInfo userInfo_; + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public boolean hasUserInfo() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo() { + return userInfo_ == null + ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+     * UserInfo is information about the requesting user
+     * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder() { + return userInfo_ == null + ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() + : userInfo_; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getKind()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getObject()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, getOldObject()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, operation_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, namespace_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeMessage(7, getResource()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, subResource_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(9, getUserInfo()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKind()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getObject()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOldObject()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, operation_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, namespace_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getResource()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, subResource_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUserInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec other = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) obj; + + boolean result = true; + result = result && (hasKind() == other.hasKind()); + if (hasKind()) { + result = result && getKind().equals(other.getKind()); + } + result = result && (hasObject() == other.hasObject()); + if (hasObject()) { + result = result && getObject().equals(other.getObject()); + } + result = result && (hasOldObject() == other.hasOldObject()); + if (hasOldObject()) { + result = result && getOldObject().equals(other.getOldObject()); + } + result = result && (hasOperation() == other.hasOperation()); + if (hasOperation()) { + result = result && getOperation().equals(other.getOperation()); + } + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName().equals(other.getName()); + } + result = result && (hasNamespace() == other.hasNamespace()); + if (hasNamespace()) { + result = result && getNamespace().equals(other.getNamespace()); + } + result = result && (hasResource() == other.hasResource()); + if (hasResource()) { + result = result && getResource().equals(other.getResource()); + } + result = result && (hasSubResource() == other.hasSubResource()); + if (hasSubResource()) { + result = result && getSubResource().equals(other.getSubResource()); + } + result = result && (hasUserInfo() == other.hasUserInfo()); + if (hasUserInfo()) { + result = result && getUserInfo().equals(other.getUserInfo()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKind()) { + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + } + if (hasObject()) { + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + } + if (hasOldObject()) { + hash = (37 * hash) + OLDOBJECT_FIELD_NUMBER; + hash = (53 * hash) + getOldObject().hashCode(); + } + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasNamespace()) { + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + } + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (hasSubResource()) { + hash = (37 * hash) + SUBRESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSubResource().hashCode(); + } + if (hasUserInfo()) { + hash = (37 * hash) + USERINFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * AdmissionReviewSpec describes the admission.Attributes for the admission request.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKindFieldBuilder(); + getObjectFieldBuilder(); + getOldObjectFieldBuilder(); + getResourceFieldBuilder(); + getUserInfoFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (kindBuilder_ == null) { + kind_ = null; + } else { + kindBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (objectBuilder_ == null) { + object_ = null; + } else { + objectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (oldObjectBuilder_ == null) { + oldObject_ = null; + } else { + oldObjectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + operation_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + namespace_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resourceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + subResource_ = ""; + bitField0_ = (bitField0_ & ~0x00000080); + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec build() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec buildPartial() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec result = + new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (kindBuilder_ == null) { + result.kind_ = kind_; + } else { + result.kind_ = kindBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (objectBuilder_ == null) { + result.object_ = object_; + } else { + result.object_ = objectBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (oldObjectBuilder_ == null) { + result.oldObject_ = oldObject_; + } else { + result.oldObject_ = oldObjectBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.operation_ = operation_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.namespace_ = namespace_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.subResource_ = subResource_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + .getDefaultInstance()) return this; + if (other.hasKind()) { + mergeKind(other.getKind()); + } + if (other.hasObject()) { + mergeObject(other.getObject()); + } + if (other.hasOldObject()) { + mergeOldObject(other.getOldObject()); + } + if (other.hasOperation()) { + bitField0_ |= 0x00000008; + operation_ = other.operation_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000010; + name_ = other.name_; + onChanged(); + } + if (other.hasNamespace()) { + bitField0_ |= 0x00000020; + namespace_ = other.namespace_; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.hasSubResource()) { + bitField0_ |= 0x00000080; + subResource_ = other.subResource_; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.GroupVersionKind kind_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionKind, + io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, + io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder> + kindBuilder_; + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public boolean hasKind() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionKind getKind() { + if (kindBuilder_ == null) { + return kind_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() + : kind_; + } else { + return kindBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public Builder setKind(io.kubernetes.client.proto.Meta.GroupVersionKind value) { + if (kindBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + kindBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public Builder setKind( + io.kubernetes.client.proto.Meta.GroupVersionKind.Builder builderForValue) { + if (kindBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + kindBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public Builder mergeKind(io.kubernetes.client.proto.Meta.GroupVersionKind value) { + if (kindBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && kind_ != null + && kind_ != io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance()) { + kind_ = + io.kubernetes.client.proto.Meta.GroupVersionKind.newBuilder(kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + kindBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public Builder clearKind() { + if (kindBuilder_ == null) { + kind_ = null; + onChanged(); + } else { + kindBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionKind.Builder getKindBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getKindFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder() { + if (kindBuilder_ != null) { + return kindBuilder_.getMessageOrBuilder(); + } else { + return kind_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() + : kind_; + } + } + /** + * + * + *
+       * Kind is the type of object being manipulated.  For example: Pod
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionKind, + io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, + io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder> + getKindFieldBuilder() { + if (kindBuilder_ == null) { + kindBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionKind, + io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, + io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder>( + getKind(), getParentForChildren(), isClean()); + kind_ = null; + } + return kindBuilder_; + } + + private io.kubernetes.client.proto.Runtime.RawExtension object_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> + objectBuilder_; + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public boolean hasObject() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public io.kubernetes.client.proto.Runtime.RawExtension getObject() { + if (objectBuilder_ == null) { + return object_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : object_; + } else { + return objectBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public Builder setObject(io.kubernetes.client.proto.Runtime.RawExtension value) { + if (objectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + object_ = value; + onChanged(); + } else { + objectBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public Builder setObject( + io.kubernetes.client.proto.Runtime.RawExtension.Builder builderForValue) { + if (objectBuilder_ == null) { + object_ = builderForValue.build(); + onChanged(); + } else { + objectBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public Builder mergeObject(io.kubernetes.client.proto.Runtime.RawExtension value) { + if (objectBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && object_ != null + && object_ != io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance()) { + object_ = + io.kubernetes.client.proto.Runtime.RawExtension.newBuilder(object_) + .mergeFrom(value) + .buildPartial(); + } else { + object_ = value; + } + onChanged(); + } else { + objectBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public Builder clearObject() { + if (objectBuilder_ == null) { + object_ = null; + onChanged(); + } else { + objectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public io.kubernetes.client.proto.Runtime.RawExtension.Builder getObjectBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getObjectFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder() { + if (objectBuilder_ != null) { + return objectBuilder_.getMessageOrBuilder(); + } else { + return object_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : object_; + } + } + /** + * + * + *
+       * Object is the object from the incoming request prior to default values being applied
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> + getObjectFieldBuilder() { + if (objectBuilder_ == null) { + objectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder>( + getObject(), getParentForChildren(), isClean()); + object_ = null; + } + return objectBuilder_; + } + + private io.kubernetes.client.proto.Runtime.RawExtension oldObject_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> + oldObjectBuilder_; + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public boolean hasOldObject() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public io.kubernetes.client.proto.Runtime.RawExtension getOldObject() { + if (oldObjectBuilder_ == null) { + return oldObject_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : oldObject_; + } else { + return oldObjectBuilder_.getMessage(); + } + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public Builder setOldObject(io.kubernetes.client.proto.Runtime.RawExtension value) { + if (oldObjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + oldObject_ = value; + onChanged(); + } else { + oldObjectBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public Builder setOldObject( + io.kubernetes.client.proto.Runtime.RawExtension.Builder builderForValue) { + if (oldObjectBuilder_ == null) { + oldObject_ = builderForValue.build(); + onChanged(); + } else { + oldObjectBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public Builder mergeOldObject(io.kubernetes.client.proto.Runtime.RawExtension value) { + if (oldObjectBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) + && oldObject_ != null + && oldObject_ + != io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance()) { + oldObject_ = + io.kubernetes.client.proto.Runtime.RawExtension.newBuilder(oldObject_) + .mergeFrom(value) + .buildPartial(); + } else { + oldObject_ = value; + } + onChanged(); + } else { + oldObjectBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public Builder clearOldObject() { + if (oldObjectBuilder_ == null) { + oldObject_ = null; + onChanged(); + } else { + oldObjectBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public io.kubernetes.client.proto.Runtime.RawExtension.Builder getOldObjectBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOldObjectFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder() { + if (oldObjectBuilder_ != null) { + return oldObjectBuilder_.getMessageOrBuilder(); + } else { + return oldObject_ == null + ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() + : oldObject_; + } + } + /** + * + * + *
+       * OldObject is the existing object. Only populated for UPDATE requests.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> + getOldObjectFieldBuilder() { + if (oldObjectBuilder_ == null) { + oldObjectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Runtime.RawExtension, + io.kubernetes.client.proto.Runtime.RawExtension.Builder, + io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder>( + getOldObject(), getParentForChildren(), isClean()); + oldObject_ = null; + } + return oldObjectBuilder_; + } + + private java.lang.Object operation_ = ""; + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + operation_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + operation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000008); + operation_ = getDefaultInstance().getOperation(); + onChanged(); + return this; + } + /** + * + * + *
+       * Operation is the operation being performed
+       * 
+ * + * optional string operation = 4; + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + operation_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000010); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
+       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
+       * +optional
+       * 
+ * + * optional string name = 5; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object namespace_ = ""; + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public Builder setNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + namespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public Builder clearNamespace() { + bitField0_ = (bitField0_ & ~0x00000020); + namespace_ = getDefaultInstance().getNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+       * Namespace is the namespace associated with the request (if any).
+       * +optional
+       * 
+ * + * optional string namespace = 6; + */ + public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + namespace_ = value; + onChanged(); + return this; + } + + private io.kubernetes.client.proto.Meta.GroupVersionResource resource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionResource, + io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, + io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder> + resourceBuilder_; + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public Builder setResource(io.kubernetes.client.proto.Meta.GroupVersionResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public Builder setResource( + io.kubernetes.client.proto.Meta.GroupVersionResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public Builder mergeResource(io.kubernetes.client.proto.Meta.GroupVersionResource value) { + if (resourceBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040) + && resource_ != null + && resource_ + != io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance()) { + resource_ = + io.kubernetes.client.proto.Meta.GroupVersionResource.newBuilder(resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resourceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionResource.Builder getResourceBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + public io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() + : resource_; + } + } + /** + * + * + *
+       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
+       * 
+ * + * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionResource, + io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, + io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.GroupVersionResource, + io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, + io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private java.lang.Object subResource_ = ""; + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public boolean hasSubResource() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public java.lang.String getSubResource() { + java.lang.Object ref = subResource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + subResource_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public com.google.protobuf.ByteString getSubResourceBytes() { + java.lang.Object ref = subResource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public Builder setSubResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + subResource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public Builder clearSubResource() { + bitField0_ = (bitField0_ & ~0x00000080); + subResource_ = getDefaultInstance().getSubResource(); + onChanged(); + return this; + } + /** + * + * + *
+       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
+       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
+       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
+       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
+       * "binding", and kind "Binding".
+       * +optional
+       * 
+ * + * optional string subResource = 8; + */ + public Builder setSubResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + subResource_ = value; + onChanged(); + return this; + } + + private io.kubernetes.client.proto.V1Authentication.UserInfo userInfo_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Authentication.UserInfo, + io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, + io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public boolean hasUserInfo() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public Builder setUserInfo(io.kubernetes.client.proto.V1Authentication.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public Builder setUserInfo( + io.kubernetes.client.proto.V1Authentication.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public Builder mergeUserInfo(io.kubernetes.client.proto.V1Authentication.UserInfo value) { + if (userInfoBuilder_ == null) { + if (((bitField0_ & 0x00000100) == 0x00000100) + && userInfo_ != null + && userInfo_ + != io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance()) { + userInfo_ = + io.kubernetes.client.proto.V1Authentication.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public io.kubernetes.client.proto.V1Authentication.UserInfo.Builder getUserInfoBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + public io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+       * UserInfo is information about the requesting user
+       * 
+ * + * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Authentication.UserInfo, + io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, + io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Authentication.UserInfo, + io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, + io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) + private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec(); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AdmissionReviewSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AdmissionReviewSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AdmissionReviewStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Allowed indicates whether or not the admission request was permitted.
+     * 
+ * + * optional bool allowed = 1; + */ + boolean hasAllowed(); + /** + * + * + *
+     * Allowed indicates whether or not the admission request was permitted.
+     * 
+ * + * optional bool allowed = 1; + */ + boolean getAllowed(); + + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + boolean hasStatus(); + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + io.kubernetes.client.proto.Meta.Status getStatus(); + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder(); + } + /** + * + * + *
+   * AdmissionReviewStatus describes the status of the admission request.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewStatus} + */ + public static final class AdmissionReviewStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) + AdmissionReviewStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use AdmissionReviewStatus.newBuilder() to construct. + private AdmissionReviewStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AdmissionReviewStatus() { + allowed_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AdmissionReviewStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: + { + bitField0_ |= 0x00000001; + allowed_ = input.readBool(); + break; + } + case 18: + { + io.kubernetes.client.proto.Meta.Status.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = status_.toBuilder(); + } + status_ = + input.readMessage( + io.kubernetes.client.proto.Meta.Status.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder.class); + } + + private int bitField0_; + public static final int ALLOWED_FIELD_NUMBER = 1; + private boolean allowed_; + /** + * + * + *
+     * Allowed indicates whether or not the admission request was permitted.
+     * 
+ * + * optional bool allowed = 1; + */ + public boolean hasAllowed() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Allowed indicates whether or not the admission request was permitted.
+     * 
+ * + * optional bool allowed = 1; + */ + public boolean getAllowed() { + return allowed_; + } + + public static final int STATUS_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.Meta.Status status_; + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public io.kubernetes.client.proto.Meta.Status getStatus() { + return status_ == null + ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() + : status_; + } + /** + * + * + *
+     * Result contains extra details into why an admission request was denied.
+     * This field IS NOT consulted in any way if "Allowed" is "true".
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder() { + return status_ == null + ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() + : status_; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, allowed_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getStatus()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, allowed_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus other = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) obj; + + boolean result = true; + result = result && (hasAllowed() == other.hasAllowed()); + if (hasAllowed()) { + result = result && (getAllowed() == other.getAllowed()); + } + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && getStatus().equals(other.getStatus()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAllowed()) { + hash = (37 * hash) + ALLOWED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowed()); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * AdmissionReviewStatus describes the status of the admission request.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.class, + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + allowed_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + if (statusBuilder_ == null) { + status_ = null; + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admission + .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus build() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus buildPartial() { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus result = + new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.allowed_ = allowed_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + .getDefaultInstance()) return this; + if (other.hasAllowed()) { + setAllowed(other.getAllowed()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private boolean allowed_; + /** + * + * + *
+       * Allowed indicates whether or not the admission request was permitted.
+       * 
+ * + * optional bool allowed = 1; + */ + public boolean hasAllowed() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Allowed indicates whether or not the admission request was permitted.
+       * 
+ * + * optional bool allowed = 1; + */ + public boolean getAllowed() { + return allowed_; + } + /** + * + * + *
+       * Allowed indicates whether or not the admission request was permitted.
+       * 
+ * + * optional bool allowed = 1; + */ + public Builder setAllowed(boolean value) { + bitField0_ |= 0x00000001; + allowed_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Allowed indicates whether or not the admission request was permitted.
+       * 
+ * + * optional bool allowed = 1; + */ + public Builder clearAllowed() { + bitField0_ = (bitField0_ & ~0x00000001); + allowed_ = false; + onChanged(); + return this; + } + + private io.kubernetes.client.proto.Meta.Status status_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Status, + io.kubernetes.client.proto.Meta.Status.Builder, + io.kubernetes.client.proto.Meta.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public io.kubernetes.client.proto.Meta.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public Builder setStatus(io.kubernetes.client.proto.Meta.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public Builder setStatus(io.kubernetes.client.proto.Meta.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public Builder mergeStatus(io.kubernetes.client.proto.Meta.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && status_ != null + && status_ != io.kubernetes.client.proto.Meta.Status.getDefaultInstance()) { + status_ = + io.kubernetes.client.proto.Meta.Status.newBuilder(status_) + .mergeFrom(value) + .buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public io.kubernetes.client.proto.Meta.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + public io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() + : status_; + } + } + /** + * + * + *
+       * Result contains extra details into why an admission request was denied.
+       * This field IS NOT consulted in any way if "Allowed" is "true".
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Status, + io.kubernetes.client.proto.Meta.Status.Builder, + io.kubernetes.client.proto.Meta.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Status, + io.kubernetes.client.proto.Meta.Status.Builder, + io.kubernetes.client.proto.Meta.StatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) + private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus(); + } + + public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AdmissionReviewStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AdmissionReviewStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-k8s.io/api/admission/v1alpha1/generate" + + "d.proto\022\035k8s.io.api.admission.v1alpha1\032," + + "k8s.io/api/authentication/v1/generated.p" + + "roto\0324k8s.io/apimachinery/pkg/apis/meta/" + + "v1/generated.proto\032/k8s.io/apimachinery/" + + "pkg/runtime/generated.proto\0326k8s.io/apim" + + "achinery/pkg/runtime/schema/generated.pr" + + "oto\0323k8s.io/apimachinery/pkg/util/intstr" + + "/generated.proto\"\231\001\n\017AdmissionReview\022@\n\004" + + "spec\030\001 \001(\01322.k8s.io.api.admission.v1alph", + "a1.AdmissionReviewSpec\022D\n\006status\030\002 \001(\01324" + + ".k8s.io.api.admission.v1alpha1.Admission" + + "ReviewStatus\"\255\003\n\023AdmissionReviewSpec\022D\n\004" + + "kind\030\001 \001(\01326.k8s.io.apimachinery.pkg.api" + + "s.meta.v1.GroupVersionKind\022=\n\006object\030\002 \001" + + "(\0132-.k8s.io.apimachinery.pkg.runtime.Raw" + + "Extension\022@\n\toldObject\030\003 \001(\0132-.k8s.io.ap" + + "imachinery.pkg.runtime.RawExtension\022\021\n\to" + + "peration\030\004 \001(\t\022\014\n\004name\030\005 \001(\t\022\021\n\tnamespac" + + "e\030\006 \001(\t\022L\n\010resource\030\007 \001(\0132:.k8s.io.apima", + "chinery.pkg.apis.meta.v1.GroupVersionRes" + + "ource\022\023\n\013subResource\030\010 \001(\t\0228\n\010userInfo\030\t" + + " \001(\0132&.k8s.io.api.authentication.v1.User" + + "Info\"f\n\025AdmissionReviewStatus\022\017\n\007allowed" + + "\030\001 \001(\010\022<\n\006status\030\002 \001(\0132,.k8s.io.apimachi" + + "nery.pkg.apis.meta.v1.StatusB9\n\032io.kuber" + + "netes.client.protoB\021V1alpha1AdmissionZ\010v" + + "1alpha1" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.kubernetes.client.proto.V1Authentication.getDescriptor(), + io.kubernetes.client.proto.Meta.getDescriptor(), + io.kubernetes.client.proto.Runtime.getDescriptor(), + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), + io.kubernetes.client.proto.IntStr.getDescriptor(), + }, + assigner); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor, + new java.lang.String[] { + "Spec", "Status", + }); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor, + new java.lang.String[] { + "Kind", + "Object", + "OldObject", + "Operation", + "Name", + "Namespace", + "Resource", + "SubResource", + "UserInfo", + }); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor, + new java.lang.String[] { + "Allowed", "Status", + }); + io.kubernetes.client.proto.V1Authentication.getDescriptor(); + io.kubernetes.client.proto.Meta.getDescriptor(); + io.kubernetes.client.proto.Runtime.getDescriptor(); + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); + io.kubernetes.client.proto.IntStr.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java new file mode 100644 index 0000000000..f2c2453736 --- /dev/null +++ b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java @@ -0,0 +1,14647 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.proto; + +public final class V1alpha1Admissionregistration { + private V1alpha1Admissionregistration() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface AdmissionHookClientConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + boolean hasService(); + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference getService(); + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder + getServiceOrBuilder(); + + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + boolean hasUrlPath(); + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + java.lang.String getUrlPath(); + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + com.google.protobuf.ByteString getUrlPathBytes(); + + /** + * + * + *
+     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+     * Required
+     * 
+ * + * optional bytes caBundle = 2; + */ + boolean hasCaBundle(); + /** + * + * + *
+     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+     * Required
+     * 
+ * + * optional bytes caBundle = 2; + */ + com.google.protobuf.ByteString getCaBundle(); + } + /** + * + * + *
+   * AdmissionHookClientConfig contains the information to make a TLS
+   * connection with the webhook
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig} + */ + public static final class AdmissionHookClientConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) + AdmissionHookClientConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AdmissionHookClientConfig.newBuilder() to construct. + private AdmissionHookClientConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AdmissionHookClientConfig() { + urlPath_ = ""; + caBundle_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AdmissionHookClientConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder + subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + bitField0_ |= 0x00000004; + caBundle_ = input.readBytes(); + break; + } + case 26: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + urlPath_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder.class); + } + + private int bitField0_; + public static final int SERVICE_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference service_; + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public boolean hasService() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference getService() { + return service_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance() + : service_; + } + /** + * + * + *
+     * Service is a reference to the service for this webhook. If there is only
+     * one port open for the service, that port will be used. If there are multiple
+     * ports open, port 443 will be used if it is open, otherwise it is an error.
+     * Required
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder + getServiceOrBuilder() { + return service_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance() + : service_; + } + + public static final int URLPATH_FIELD_NUMBER = 3; + private volatile java.lang.Object urlPath_; + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + public boolean hasUrlPath() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + public java.lang.String getUrlPath() { + java.lang.Object ref = urlPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + urlPath_ = s; + } + return s; + } + } + /** + * + * + *
+     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+     * 
+ * + * optional string urlPath = 3; + */ + public com.google.protobuf.ByteString getUrlPathBytes() { + java.lang.Object ref = urlPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + urlPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CABUNDLE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString caBundle_; + /** + * + * + *
+     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+     * Required
+     * 
+ * + * optional bytes caBundle = 2; + */ + public boolean hasCaBundle() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+     * Required
+     * 
+ * + * optional bytes caBundle = 2; + */ + public com.google.protobuf.ByteString getCaBundle() { + return caBundle_; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getService()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(2, caBundle_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, urlPath_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getService()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, caBundle_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, urlPath_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) obj; + + boolean result = true; + result = result && (hasService() == other.hasService()); + if (hasService()) { + result = result && getService().equals(other.getService()); + } + result = result && (hasUrlPath() == other.hasUrlPath()); + if (hasUrlPath()) { + result = result && getUrlPath().equals(other.getUrlPath()); + } + result = result && (hasCaBundle() == other.hasCaBundle()); + if (hasCaBundle()) { + result = result && getCaBundle().equals(other.getCaBundle()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + if (hasUrlPath()) { + hash = (37 * hash) + URLPATH_FIELD_NUMBER; + hash = (53 * hash) + getUrlPath().hashCode(); + } + if (hasCaBundle()) { + hash = (37 * hash) + CABUNDLE_FIELD_NUMBER; + hash = (53 * hash) + getCaBundle().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * AdmissionHookClientConfig contains the information to make a TLS
+     * connection with the webhook
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServiceFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (serviceBuilder_ == null) { + service_ = null; + } else { + serviceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + urlPath_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + caBundle_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig( + this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.urlPath_ = urlPath_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.caBundle_ = caBundle_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance()) return this; + if (other.hasService()) { + mergeService(other.getService()); + } + if (other.hasUrlPath()) { + bitField0_ |= 0x00000002; + urlPath_ = other.urlPath_; + onChanged(); + } + if (other.hasCaBundle()) { + setCaBundle(other.getCaBundle()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference service_ = + null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder> + serviceBuilder_; + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public boolean hasService() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public Builder setService( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public Builder setService( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder + builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public Builder mergeService( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference value) { + if (serviceBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && service_ != null + && service_ + != io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance()) { + service_ = + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + serviceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder + getServiceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder + getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance() + : service_; + } + } + /** + * + * + *
+       * Service is a reference to the service for this webhook. If there is only
+       * one port open for the service, that port will be used. If there are multiple
+       * ports open, port 443 will be used if it is open, otherwise it is an error.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ServiceReferenceOrBuilder>(getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + private java.lang.Object urlPath_ = ""; + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public boolean hasUrlPath() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public java.lang.String getUrlPath() { + java.lang.Object ref = urlPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + urlPath_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public com.google.protobuf.ByteString getUrlPathBytes() { + java.lang.Object ref = urlPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + urlPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public Builder setUrlPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + urlPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public Builder clearUrlPath() { + bitField0_ = (bitField0_ & ~0x00000002); + urlPath_ = getDefaultInstance().getUrlPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
+       * 
+ * + * optional string urlPath = 3; + */ + public Builder setUrlPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + urlPath_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString caBundle_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+       * Required
+       * 
+ * + * optional bytes caBundle = 2; + */ + public boolean hasCaBundle() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+       * Required
+       * 
+ * + * optional bytes caBundle = 2; + */ + public com.google.protobuf.ByteString getCaBundle() { + return caBundle_; + } + /** + * + * + *
+       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+       * Required
+       * 
+ * + * optional bytes caBundle = 2; + */ + public Builder setCaBundle(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + caBundle_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
+       * Required
+       * 
+ * + * optional bytes caBundle = 2; + */ + public Builder clearCaBundle() { + bitField0_ = (bitField0_ & ~0x00000004); + caBundle_ = getDefaultInstance().getCaBundle(); + onChanged(); + return this; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AdmissionHookClientConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AdmissionHookClientConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExternalAdmissionHookOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + boolean hasName(); + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + boolean hasClientConfig(); + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getClientConfig(); + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfigOrBuilder + getClientConfigOrBuilder(); + + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + java.util.List + getRulesList(); + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules(int index); + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + int getRulesCount(); + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .RuleWithOperationsOrBuilder> + getRulesOrBuilderList(); + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder + getRulesOrBuilder(int index); + + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + boolean hasFailurePolicy(); + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + java.lang.String getFailurePolicy(); + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + com.google.protobuf.ByteString getFailurePolicyBytes(); + } + /** + * + * + *
+   * ExternalAdmissionHook describes an external admission webhook and the
+   * resources and operations it applies to.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook} + */ + public static final class ExternalAdmissionHook extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) + ExternalAdmissionHookOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalAdmissionHook.newBuilder() to construct. + private ExternalAdmissionHook(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExternalAdmissionHook() { + name_ = ""; + rules_ = java.util.Collections.emptyList(); + failurePolicy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExternalAdmissionHook( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: + { + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder + subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = clientConfig_.toBuilder(); + } + clientConfig_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfig.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientConfig_); + clientConfig_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + rules_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .RuleWithOperations>(); + mutable_bitField0_ |= 0x00000004; + } + rules_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .PARSER, + extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + failurePolicy_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + .class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * + * + *
+     * The name of the external admission webhook.
+     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required.
+     * 
+ * + * optional string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENTCONFIG_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + clientConfig_; + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public boolean hasClientConfig() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getClientConfig() { + return clientConfig_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance() + : clientConfig_; + } + /** + * + * + *
+     * ClientConfig defines how to communicate with the hook.
+     * Required
+     * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder + getClientConfigOrBuilder() { + return clientConfig_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance() + : clientConfig_; + } + + public static final int RULES_FIELD_NUMBER = 3; + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> + rules_; + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> + getRulesList() { + return rules_; + } + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .RuleWithOperationsOrBuilder> + getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules( + int index) { + return rules_.get(index); + } + /** + * + * + *
+     * Rules describes what operations on what resources/subresources the webhook cares about.
+     * The webhook cares about an operation if it matches _any_ Rule.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder + getRulesOrBuilder(int index) { + return rules_.get(index); + } + + public static final int FAILUREPOLICY_FIELD_NUMBER = 4; + private volatile java.lang.Object failurePolicy_; + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + public boolean hasFailurePolicy() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + public java.lang.String getFailurePolicy() { + java.lang.Object ref = failurePolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + failurePolicy_ = s; + } + return s; + } + } + /** + * + * + *
+     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+     * allowed values are Ignore or Fail. Defaults to Ignore.
+     * +optional
+     * 
+ * + * optional string failurePolicy = 4; + */ + public com.google.protobuf.ByteString getFailurePolicyBytes() { + java.lang.Object ref = failurePolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failurePolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getClientConfig()); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(3, rules_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, failurePolicy_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClientConfig()); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, failurePolicy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName().equals(other.getName()); + } + result = result && (hasClientConfig() == other.hasClientConfig()); + if (hasClientConfig()) { + result = result && getClientConfig().equals(other.getClientConfig()); + } + result = result && getRulesList().equals(other.getRulesList()); + result = result && (hasFailurePolicy() == other.hasFailurePolicy()); + if (hasFailurePolicy()) { + result = result && getFailurePolicy().equals(other.getFailurePolicy()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasClientConfig()) { + hash = (37 * hash) + CLIENTCONFIG_FIELD_NUMBER; + hash = (53 * hash) + getClientConfig().hashCode(); + } + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + if (hasFailurePolicy()) { + hash = (37 * hash) + FAILUREPOLICY_FIELD_NUMBER; + hash = (53 * hash) + getFailurePolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * ExternalAdmissionHook describes an external admission webhook and the
+     * resources and operations it applies to.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClientConfigFieldBuilder(); + getRulesFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (clientConfigBuilder_ == null) { + clientConfig_ = null; + } else { + clientConfigBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + rulesBuilder_.clear(); + } + failurePolicy_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook( + this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (clientConfigBuilder_ == null) { + result.clientConfig_ = clientConfig_; + } else { + result.clientConfig_ = clientConfigBuilder_.build(); + } + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.failurePolicy_ = failurePolicy_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasClientConfig()) { + mergeClientConfig(other.getClientConfig()); + } + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000004); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + if (other.hasFailurePolicy()) { + bitField0_ |= 0x00000008; + failurePolicy_ = other.failurePolicy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the external admission webhook.
+       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
+       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required.
+       * 
+ * + * optional string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + clientConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig, + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder> + clientConfigBuilder_; + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public boolean hasClientConfig() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + getClientConfig() { + if (clientConfigBuilder_ == null) { + return clientConfig_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance() + : clientConfig_; + } else { + return clientConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public Builder setClientConfig( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + value) { + if (clientConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientConfig_ = value; + onChanged(); + } else { + clientConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public Builder setClientConfig( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig.Builder + builderForValue) { + if (clientConfigBuilder_ == null) { + clientConfig_ = builderForValue.build(); + onChanged(); + } else { + clientConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public Builder mergeClientConfig( + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + value) { + if (clientConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && clientConfig_ != null + && clientConfig_ + != io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfig.getDefaultInstance()) { + clientConfig_ = + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .newBuilder(clientConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + clientConfig_ = value; + } + onChanged(); + } else { + clientConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public Builder clearClientConfig() { + if (clientConfigBuilder_ == null) { + clientConfig_ = null; + onChanged(); + } else { + clientConfigBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder + getClientConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClientConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder + getClientConfigOrBuilder() { + if (clientConfigBuilder_ != null) { + return clientConfigBuilder_.getMessageOrBuilder(); + } else { + return clientConfig_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .getDefaultInstance() + : clientConfig_; + } + } + /** + * + * + *
+       * ClientConfig defines how to communicate with the hook.
+       * Required
+       * 
+ * + * + * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig, + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder> + getClientConfigFieldBuilder() { + if (clientConfigBuilder_ == null) { + clientConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfig, + io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .AdmissionHookClientConfigOrBuilder>( + getClientConfig(), getParentForChildren(), isClean()); + clientConfig_ = null; + } + return clientConfigBuilder_; + } + + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> + rules_ = java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + rules_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations>( + rules_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder> + rulesBuilder_; + + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> + getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules( + int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder setRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder setRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder addRules( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder addRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder addRules( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder addRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder addAllRules( + java.lang.Iterable< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> + values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + getRulesBuilder(int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder + getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .RuleWithOperationsOrBuilder> + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + addRulesBuilder() { + return getRulesFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .getDefaultInstance()); + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + addRulesBuilder(int index) { + return getRulesFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .getDefaultInstance()); + } + /** + * + * + *
+       * Rules describes what operations on what resources/subresources the webhook cares about.
+       * The webhook cares about an operation if it matches _any_ Rule.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder> + getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .RuleWithOperationsOrBuilder>( + rules_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + private java.lang.Object failurePolicy_ = ""; + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public boolean hasFailurePolicy() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public java.lang.String getFailurePolicy() { + java.lang.Object ref = failurePolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + failurePolicy_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public com.google.protobuf.ByteString getFailurePolicyBytes() { + java.lang.Object ref = failurePolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failurePolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public Builder setFailurePolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + failurePolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public Builder clearFailurePolicy() { + bitField0_ = (bitField0_ & ~0x00000008); + failurePolicy_ = getDefaultInstance().getFailurePolicy(); + onChanged(); + return this; + } + /** + * + * + *
+       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
+       * allowed values are Ignore or Fail. Defaults to Ignore.
+       * +optional
+       * 
+ * + * optional string failurePolicy = 4; + */ + public Builder setFailurePolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + failurePolicy_ = value; + onChanged(); + return this; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHook + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ExternalAdmissionHook parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalAdmissionHook(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExternalAdmissionHookConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + java.util.List + getExternalAdmissionHooksList(); + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getExternalAdmissionHooks(int index); + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + int getExternalAdmissionHooksCount(); + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder> + getExternalAdmissionHooksOrBuilderList(); + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder + getExternalAdmissionHooksOrBuilder(int index); + } + /** + * + * + *
+   * ExternalAdmissionHookConfiguration describes the configuration of initializers.
+   * 
+ * + * Protobuf type {@code + * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration} + */ + public static final class ExternalAdmissionHookConfiguration + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) + ExternalAdmissionHookConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalAdmissionHookConfiguration.newBuilder() to construct. + private ExternalAdmissionHookConfiguration( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExternalAdmissionHookConfiguration() { + externalAdmissionHooks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExternalAdmissionHookConfiguration( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + externalAdmissionHooks_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHook>(); + mutable_bitField0_ |= 0x00000002; + } + externalAdmissionHooks_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHook.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + externalAdmissionHooks_ = java.util.Collections.unmodifiableList(externalAdmissionHooks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int EXTERNALADMISSIONHOOKS_FIELD_NUMBER = 2; + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> + externalAdmissionHooks_; + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> + getExternalAdmissionHooksList() { + return externalAdmissionHooks_; + } + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder> + getExternalAdmissionHooksOrBuilderList() { + return externalAdmissionHooks_; + } + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public int getExternalAdmissionHooksCount() { + return externalAdmissionHooks_.size(); + } + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getExternalAdmissionHooks(int index) { + return externalAdmissionHooks_.get(index); + } + /** + * + * + *
+     * ExternalAdmissionHooks is a list of external admission webhooks and the
+     * affected resources and operations.
+     * +optional
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder + getExternalAdmissionHooksOrBuilder(int index) { + return externalAdmissionHooks_.get(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < externalAdmissionHooks_.size(); i++) { + output.writeMessage(2, externalAdmissionHooks_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < externalAdmissionHooks_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, externalAdmissionHooks_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration) + obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = + result && getExternalAdmissionHooksList().equals(other.getExternalAdmissionHooksList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getExternalAdmissionHooksCount() > 0) { + hash = (37 * hash) + EXTERNALADMISSIONHOOKS_FIELD_NUMBER; + hash = (53 * hash) + getExternalAdmissionHooksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * ExternalAdmissionHookConfiguration describes the configuration of initializers.
+     * 
+ * + * Protobuf type {@code + * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getExternalAdmissionHooksFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (externalAdmissionHooksBuilder_ == null) { + externalAdmissionHooks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + externalAdmissionHooksBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (externalAdmissionHooksBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + externalAdmissionHooks_ = + java.util.Collections.unmodifiableList(externalAdmissionHooks_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.externalAdmissionHooks_ = externalAdmissionHooks_; + } else { + result.externalAdmissionHooks_ = externalAdmissionHooksBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (externalAdmissionHooksBuilder_ == null) { + if (!other.externalAdmissionHooks_.isEmpty()) { + if (externalAdmissionHooks_.isEmpty()) { + externalAdmissionHooks_ = other.externalAdmissionHooks_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.addAll(other.externalAdmissionHooks_); + } + onChanged(); + } + } else { + if (!other.externalAdmissionHooks_.isEmpty()) { + if (externalAdmissionHooksBuilder_.isEmpty()) { + externalAdmissionHooksBuilder_.dispose(); + externalAdmissionHooksBuilder_ = null; + externalAdmissionHooks_ = other.externalAdmissionHooks_; + bitField0_ = (bitField0_ & ~0x00000002); + externalAdmissionHooksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExternalAdmissionHooksFieldBuilder() + : null; + } else { + externalAdmissionHooksBuilder_.addAllMessages(other.externalAdmissionHooks_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> + externalAdmissionHooks_ = java.util.Collections.emptyList(); + + private void ensureExternalAdmissionHooksIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + externalAdmissionHooks_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook>( + externalAdmissionHooks_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder> + externalAdmissionHooksBuilder_; + + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> + getExternalAdmissionHooksList() { + if (externalAdmissionHooksBuilder_ == null) { + return java.util.Collections.unmodifiableList(externalAdmissionHooks_); + } else { + return externalAdmissionHooksBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public int getExternalAdmissionHooksCount() { + if (externalAdmissionHooksBuilder_ == null) { + return externalAdmissionHooks_.size(); + } else { + return externalAdmissionHooksBuilder_.getCount(); + } + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + getExternalAdmissionHooks(int index) { + if (externalAdmissionHooksBuilder_ == null) { + return externalAdmissionHooks_.get(index); + } else { + return externalAdmissionHooksBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder setExternalAdmissionHooks( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { + if (externalAdmissionHooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.set(index, value); + onChanged(); + } else { + externalAdmissionHooksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder setExternalAdmissionHooks( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + builderForValue) { + if (externalAdmissionHooksBuilder_ == null) { + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.set(index, builderForValue.build()); + onChanged(); + } else { + externalAdmissionHooksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder addExternalAdmissionHooks( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { + if (externalAdmissionHooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.add(value); + onChanged(); + } else { + externalAdmissionHooksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder addExternalAdmissionHooks( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { + if (externalAdmissionHooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.add(index, value); + onChanged(); + } else { + externalAdmissionHooksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder addExternalAdmissionHooks( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + builderForValue) { + if (externalAdmissionHooksBuilder_ == null) { + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.add(builderForValue.build()); + onChanged(); + } else { + externalAdmissionHooksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder addExternalAdmissionHooks( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + builderForValue) { + if (externalAdmissionHooksBuilder_ == null) { + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.add(index, builderForValue.build()); + onChanged(); + } else { + externalAdmissionHooksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder addAllExternalAdmissionHooks( + java.lang.Iterable< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHook> + values) { + if (externalAdmissionHooksBuilder_ == null) { + ensureExternalAdmissionHooksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, externalAdmissionHooks_); + onChanged(); + } else { + externalAdmissionHooksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder clearExternalAdmissionHooks() { + if (externalAdmissionHooksBuilder_ == null) { + externalAdmissionHooks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + externalAdmissionHooksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public Builder removeExternalAdmissionHooks(int index) { + if (externalAdmissionHooksBuilder_ == null) { + ensureExternalAdmissionHooksIsMutable(); + externalAdmissionHooks_.remove(index); + onChanged(); + } else { + externalAdmissionHooksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + getExternalAdmissionHooksBuilder(int index) { + return getExternalAdmissionHooksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder + getExternalAdmissionHooksOrBuilder(int index) { + if (externalAdmissionHooksBuilder_ == null) { + return externalAdmissionHooks_.get(index); + } else { + return externalAdmissionHooksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder> + getExternalAdmissionHooksOrBuilderList() { + if (externalAdmissionHooksBuilder_ != null) { + return externalAdmissionHooksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(externalAdmissionHooks_); + } + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + addExternalAdmissionHooksBuilder() { + return getExternalAdmissionHooksFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .getDefaultInstance()); + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder + addExternalAdmissionHooksBuilder(int index) { + return getExternalAdmissionHooksFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .getDefaultInstance()); + } + /** + * + * + *
+       * ExternalAdmissionHooks is a list of external admission webhooks and the
+       * affected resources and operations.
+       * +optional
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .Builder> + getExternalAdmissionHooksBuilderList() { + return getExternalAdmissionHooksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder> + getExternalAdmissionHooksFieldBuilder() { + if (externalAdmissionHooksBuilder_ == null) { + externalAdmissionHooksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookOrBuilder>( + externalAdmissionHooks_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + externalAdmissionHooks_ = null; + } + return externalAdmissionHooksBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ExternalAdmissionHookConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalAdmissionHookConfiguration(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExternalAdmissionHookConfigurationListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMeta getMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + getItemsList(); + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration + getItems(int index); + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + int getItemsCount(); + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder> + getItemsOrBuilderList(); + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder + getItemsOrBuilder(int index); + } + /** + * + * + *
+   * ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration.
+   * 
+ * + * Protobuf type {@code + * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList} + */ + public static final class ExternalAdmissionHookConfigurationList + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) + ExternalAdmissionHookConfigurationListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExternalAdmissionHookConfigurationList.newBuilder() to construct. + private ExternalAdmissionHookConfigurationList( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExternalAdmissionHookConfigurationList() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExternalAdmissionHookConfigurationList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration>(); + mutable_bitField0_ |= 0x00000002; + } + items_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ListMeta metadata_; + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + + public static final int ITEMS_FIELD_NUMBER = 2; + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + items_; + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + getItemsList() { + return items_; + } + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder> + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+     * List of ExternalAdmissionHookConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder + getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList) + obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && getItemsList().equals(other.getItemsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration.
+     * 
+ * + * Protobuf type {@code + * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfigurationList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getItemsFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + itemsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList.getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + items_ = java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration>(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder> + itemsBuilder_; + + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder setItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder setItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder addItems( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder addItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration + value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder addItems( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder addItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder addAllItems( + java.lang.Iterable< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration> + values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + getItemsBuilder(int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder + getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder> + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.getDefaultInstance()); + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder + addItemsBuilder(int index) { + return getItemsFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.getDefaultInstance()); + } + /** + * + * + *
+       * List of ExternalAdmissionHookConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder> + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfiguration.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationOrBuilder>( + items_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ExternalAdmissionHookConfigurationList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExternalAdmissionHookConfigurationList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .ExternalAdmissionHookConfigurationList + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InitializerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.Initializer) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + boolean hasName(); + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + java.util.List getRulesList(); + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index); + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + int getRulesCount(); + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + java.util.List + getRulesOrBuilderList(); + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRulesOrBuilder( + int index); + } + /** + * + * + *
+   * Initializer describes the name and the failure policy of an initializer, and
+   * what resources it applies to.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Initializer} + */ + public static final class Initializer extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.Initializer) + InitializerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Initializer.newBuilder() to construct. + private Initializer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Initializer() { + name_ = ""; + rules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Initializer( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + name_ = bs; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + rules_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule>(); + mutable_bitField0_ |= 0x00000002; + } + rules_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name is the identifier of the initializer. It will be added to the
+     * object that needs to be initialized.
+     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+     * of the organization.
+     * Required
+     * 
+ * + * optional string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RULES_FIELD_NUMBER = 2; + private java.util.List rules_; + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public java.util.List + getRulesList() { + return rules_; + } + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public java.util.List< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index) { + return rules_.get(index); + } + /** + * + * + *
+     * Rules describes what resources/subresources the initializer cares about.
+     * The initializer cares about an operation if it matches _any_ Rule.
+     * Rule.Resources must not include subresources.
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRulesOrBuilder( + int index) { + return rules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(2, rules_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rules_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) obj; + + boolean result = true; + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName().equals(other.getName()); + } + result = result && getRulesList().equals(other.getRulesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Initializer describes the name and the failure policy of an initializer, and
+     * what resources it applies to.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Initializer} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.Initializer) + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRulesFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + rulesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + .getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000002); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the identifier of the initializer. It will be added to the
+       * object that needs to be initialized.
+       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
+       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
+       * of the organization.
+       * Required
+       * 
+ * + * optional string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + rules_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule>(rules_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public java.util.List + getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder setRules( + int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder setRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder addRules(io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder addRules( + int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder addRules( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder addRules( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder addAllRules( + java.lang.Iterable< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule> + values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder getRulesBuilder( + int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder + getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public java.util.List< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder + addRulesBuilder() { + return getRulesFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()); + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder addRulesBuilder( + int index) { + return getRulesFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()); + } + /** + * + * + *
+       * Rules describes what resources/subresources the initializer cares about.
+       * The initializer cares about an operation if it matches _any_ Rule.
+       * Rule.Resources must not include subresources.
+       * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; + */ + public java.util.List + getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder>( + rules_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.Initializer) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.Initializer) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Initializer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Initializer(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InitializerConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + java.util.List + getInitializersList(); + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers(int index); + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + int getInitializersCount(); + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + java.util.List< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> + getInitializersOrBuilderList(); + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder + getInitializersOrBuilder(int index); + } + /** + * + * + *
+   * InitializerConfiguration describes the configuration of initializers.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration} + */ + public static final class InitializerConfiguration extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) + InitializerConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + // Use InitializerConfiguration.newBuilder() to construct. + private InitializerConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InitializerConfiguration() { + initializers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InitializerConfiguration( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + initializers_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer>(); + mutable_bitField0_ |= 0x00000002; + } + initializers_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + initializers_ = java.util.Collections.unmodifiableList(initializers_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int INITIALIZERS_FIELD_NUMBER = 2; + private java.util.List + initializers_; + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public java.util.List + getInitializersList() { + return initializers_; + } + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public java.util.List< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> + getInitializersOrBuilderList() { + return initializers_; + } + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public int getInitializersCount() { + return initializers_.size(); + } + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers( + int index) { + return initializers_.get(index); + } + /** + * + * + *
+     * Initializers is a list of resources and their default initializers
+     * Order-sensitive.
+     * When merging multiple InitializerConfigurations, we sort the initializers
+     * from different InitializerConfigurations by the name of the
+     * InitializerConfigurations; the order of the initializers from the same
+     * InitializerConfiguration is preserved.
+     * +patchMergeKey=name
+     * +patchStrategy=merge
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder + getInitializersOrBuilder(int index) { + return initializers_.get(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < initializers_.size(); i++) { + output.writeMessage(2, initializers_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < initializers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, initializers_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && getInitializersList().equals(other.getInitializersList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getInitializersCount() > 0) { + hash = (37 * hash) + INITIALIZERS_FIELD_NUMBER; + hash = (53 * hash) + getInitializersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * InitializerConfiguration describes the configuration of initializers.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getInitializersFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (initializersBuilder_ == null) { + initializers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + initializersBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration( + this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (initializersBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + initializers_ = java.util.Collections.unmodifiableList(initializers_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.initializers_ = initializers_; + } else { + result.initializers_ = initializersBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (initializersBuilder_ == null) { + if (!other.initializers_.isEmpty()) { + if (initializers_.isEmpty()) { + initializers_ = other.initializers_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInitializersIsMutable(); + initializers_.addAll(other.initializers_); + } + onChanged(); + } + } else { + if (!other.initializers_.isEmpty()) { + if (initializersBuilder_.isEmpty()) { + initializersBuilder_.dispose(); + initializersBuilder_ = null; + initializers_ = other.initializers_; + bitField0_ = (bitField0_ & ~0x00000002); + initializersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInitializersFieldBuilder() + : null; + } else { + initializersBuilder_.addAllMessages(other.initializers_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List + initializers_ = java.util.Collections.emptyList(); + + private void ensureInitializersIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + initializers_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer>( + initializers_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> + initializersBuilder_; + + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public java.util.List + getInitializersList() { + if (initializersBuilder_ == null) { + return java.util.Collections.unmodifiableList(initializers_); + } else { + return initializersBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public int getInitializersCount() { + if (initializersBuilder_ == null) { + return initializers_.size(); + } else { + return initializersBuilder_.getCount(); + } + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers( + int index) { + if (initializersBuilder_ == null) { + return initializers_.get(index); + } else { + return initializersBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder setInitializers( + int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { + if (initializersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitializersIsMutable(); + initializers_.set(index, value); + onChanged(); + } else { + initializersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder setInitializers( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + builderForValue) { + if (initializersBuilder_ == null) { + ensureInitializersIsMutable(); + initializers_.set(index, builderForValue.build()); + onChanged(); + } else { + initializersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder addInitializers( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { + if (initializersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitializersIsMutable(); + initializers_.add(value); + onChanged(); + } else { + initializersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder addInitializers( + int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { + if (initializersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitializersIsMutable(); + initializers_.add(index, value); + onChanged(); + } else { + initializersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder addInitializers( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + builderForValue) { + if (initializersBuilder_ == null) { + ensureInitializersIsMutable(); + initializers_.add(builderForValue.build()); + onChanged(); + } else { + initializersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder addInitializers( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + builderForValue) { + if (initializersBuilder_ == null) { + ensureInitializersIsMutable(); + initializers_.add(index, builderForValue.build()); + onChanged(); + } else { + initializersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder addAllInitializers( + java.lang.Iterable< + ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer> + values) { + if (initializersBuilder_ == null) { + ensureInitializersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, initializers_); + onChanged(); + } else { + initializersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder clearInitializers() { + if (initializersBuilder_ == null) { + initializers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + initializersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public Builder removeInitializers(int index) { + if (initializersBuilder_ == null) { + ensureInitializersIsMutable(); + initializers_.remove(index); + onChanged(); + } else { + initializersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + getInitializersBuilder(int index) { + return getInitializersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder + getInitializersOrBuilder(int index) { + if (initializersBuilder_ == null) { + return initializers_.get(index); + } else { + return initializersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> + getInitializersOrBuilderList() { + if (initializersBuilder_ != null) { + return initializersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(initializers_); + } + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + addInitializersBuilder() { + return getInitializersFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + .getDefaultInstance()); + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder + addInitializersBuilder(int index) { + return getInitializersFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer + .getDefaultInstance()); + } + /** + * + * + *
+       * Initializers is a list of resources and their default initializers
+       * Order-sensitive.
+       * When merging multiple InitializerConfigurations, we sort the initializers
+       * from different InitializerConfigurations by the name of the
+       * InitializerConfigurations; the order of the initializers from the same
+       * InitializerConfiguration is preserved.
+       * +patchMergeKey=name
+       * +patchStrategy=merge
+       * +optional
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder> + getInitializersBuilderList() { + return getInitializersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> + getInitializersFieldBuilder() { + if (initializersBuilder_ == null) { + initializersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder>( + initializers_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + initializers_ = null; + } + return initializersBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public InitializerConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InitializerConfiguration(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InitializerConfigurationListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMeta getMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> + getItemsList(); + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration getItems( + int index); + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + int getItemsCount(); + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder> + getItemsOrBuilderList(); + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationOrBuilder + getItemsOrBuilder(int index); + } + /** + * + * + *
+   * InitializerConfigurationList is a list of InitializerConfiguration.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList} + */ + public static final class InitializerConfigurationList + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) + InitializerConfigurationListOrBuilder { + private static final long serialVersionUID = 0L; + // Use InitializerConfigurationList.newBuilder() to construct. + private InitializerConfigurationList( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InitializerConfigurationList() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InitializerConfigurationList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfiguration>(); + mutable_bitField0_ |= 0x00000002; + } + items_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfiguration.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + .class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + .Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ListMeta metadata_; + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + + public static final int ITEMS_FIELD_NUMBER = 2; + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> + items_; + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> + getItemsList() { + return items_; + } + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder> + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+     * List of InitializerConfiguration.
+     * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder + getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList) + obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && getItemsList().equals(other.getItemsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * InitializerConfigurationList is a list of InitializerConfiguration.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getItemsFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + itemsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + .getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> + items_ = java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfiguration>(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder> + itemsBuilder_; + + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> + getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder setItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder setItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder addItems( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder addItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder addItems( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder addItems( + int index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder + builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder addAllItems( + java.lang.Iterable< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfiguration> + values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder + getItemsBuilder(int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder + getItemsOrBuilder(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public java.util.List< + ? extends + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder> + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder + addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .getDefaultInstance()); + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder + addItemsBuilder(int index) { + return getItemsFieldBuilder() + .addBuilder( + index, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .getDefaultInstance()); + } + /** + * + * + *
+       * List of InitializerConfiguration.
+       * 
+ * + * + * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; + * + */ + public java.util.List< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder> + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, + io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration + .Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationOrBuilder>( + items_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration + .InitializerConfigurationList + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public InitializerConfigurationList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InitializerConfigurationList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + java.util.List getApiGroupsList(); + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + int getApiGroupsCount(); + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + java.lang.String getApiGroups(int index); + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + com.google.protobuf.ByteString getApiGroupsBytes(int index); + + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + java.util.List getApiVersionsList(); + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + int getApiVersionsCount(); + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + java.lang.String getApiVersions(int index); + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + com.google.protobuf.ByteString getApiVersionsBytes(int index); + + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + java.util.List getResourcesList(); + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + int getResourcesCount(); + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + java.lang.String getResources(int index); + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + com.google.protobuf.ByteString getResourcesBytes(int index); + } + /** + * + * + *
+   * Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
+   * to make sure that all the tuple expansions are valid.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Rule} + */ + public static final class Rule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.Rule) + RuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rule.newBuilder() to construct. + private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rule() { + apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + apiGroups_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + apiGroups_.add(bs); + break; + } + case 18: + { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + apiVersions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + apiVersions_.add(bs); + break; + } + case 26: + { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + resources_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + resources_.add(bs); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + apiGroups_ = apiGroups_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + apiVersions_ = apiVersions_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + resources_ = resources_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder.class); + } + + public static final int APIGROUPS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList apiGroups_; + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + public com.google.protobuf.ProtocolStringList getApiGroupsList() { + return apiGroups_; + } + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + public int getApiGroupsCount() { + return apiGroups_.size(); + } + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + public java.lang.String getApiGroups(int index) { + return apiGroups_.get(index); + } + /** + * + * + *
+     * APIGroups is the API groups the resources belong to. '*' is all groups.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiGroups = 1; + */ + public com.google.protobuf.ByteString getApiGroupsBytes(int index) { + return apiGroups_.getByteString(index); + } + + public static final int APIVERSIONS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList apiVersions_; + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + public com.google.protobuf.ProtocolStringList getApiVersionsList() { + return apiVersions_; + } + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + public int getApiVersionsCount() { + return apiVersions_.size(); + } + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + public java.lang.String getApiVersions(int index) { + return apiVersions_.get(index); + } + /** + * + * + *
+     * APIVersions is the API versions the resources belong to. '*' is all versions.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string apiVersions = 2; + */ + public com.google.protobuf.ByteString getApiVersionsBytes(int index) { + return apiVersions_.getByteString(index); + } + + public static final int RESOURCES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList resources_; + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_; + } + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + public int getResourcesCount() { + return resources_.size(); + } + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + /** + * + * + *
+     * Resources is a list of resources this rule applies to.
+     *
+     * For example:
+     * 'pods' means pods.
+     * 'pods/log' means the log subresource of pods.
+     * '*' means all resources, but not subresources.
+     * 'pods/*' means all subresources of pods.
+     * '*/scale' means all scale subresources.
+     * '*/*' means all resources and their subresources.
+     *
+     * If wildcard is present, the validation rule will ensure resources do not
+     * overlap with each other.
+     *
+     * Depending on the enclosing object, subresources might not be allowed.
+     * Required.
+     * 
+ * + * repeated string resources = 3; + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < apiGroups_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, apiGroups_.getRaw(i)); + } + for (int i = 0; i < apiVersions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, apiVersions_.getRaw(i)); + } + for (int i = 0; i < resources_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resources_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < apiGroups_.size(); i++) { + dataSize += computeStringSizeNoTag(apiGroups_.getRaw(i)); + } + size += dataSize; + size += 1 * getApiGroupsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < apiVersions_.size(); i++) { + dataSize += computeStringSizeNoTag(apiVersions_.getRaw(i)); + } + size += dataSize; + size += 1 * getApiVersionsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < resources_.size(); i++) { + dataSize += computeStringSizeNoTag(resources_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourcesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) obj; + + boolean result = true; + result = result && getApiGroupsList().equals(other.getApiGroupsList()); + result = result && getApiVersionsList().equals(other.getApiVersionsList()); + result = result && getResourcesList().equals(other.getResourcesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getApiGroupsCount() > 0) { + hash = (37 * hash) + APIGROUPS_FIELD_NUMBER; + hash = (53 * hash) + getApiGroupsList().hashCode(); + } + if (getApiVersionsCount() > 0) { + hash = (37 * hash) + APIVERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getApiVersionsList().hashCode(); + } + if (getResourcesCount() > 0) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResourcesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
+     * to make sure that all the tuple expansions are valid.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Rule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.Rule) + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + public Builder clear() { + super.clear(); + apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + apiGroups_ = apiGroups_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.apiGroups_ = apiGroups_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + apiVersions_ = apiVersions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.apiVersions_ = apiVersions_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + resources_ = resources_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.resources_ = resources_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) { + return mergeFrom((io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()) + return this; + if (!other.apiGroups_.isEmpty()) { + if (apiGroups_.isEmpty()) { + apiGroups_ = other.apiGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureApiGroupsIsMutable(); + apiGroups_.addAll(other.apiGroups_); + } + onChanged(); + } + if (!other.apiVersions_.isEmpty()) { + if (apiVersions_.isEmpty()) { + apiVersions_ = other.apiVersions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureApiVersionsIsMutable(); + apiVersions_.addAll(other.apiVersions_); + } + onChanged(); + } + if (!other.resources_.isEmpty()) { + if (resources_.isEmpty()) { + resources_ = other.resources_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResourcesIsMutable(); + resources_.addAll(other.resources_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList apiGroups_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureApiGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + apiGroups_ = new com.google.protobuf.LazyStringArrayList(apiGroups_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public com.google.protobuf.ProtocolStringList getApiGroupsList() { + return apiGroups_.getUnmodifiableView(); + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public int getApiGroupsCount() { + return apiGroups_.size(); + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public java.lang.String getApiGroups(int index) { + return apiGroups_.get(index); + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public com.google.protobuf.ByteString getApiGroupsBytes(int index) { + return apiGroups_.getByteString(index); + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public Builder setApiGroups(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiGroupsIsMutable(); + apiGroups_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public Builder addApiGroups(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiGroupsIsMutable(); + apiGroups_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public Builder addAllApiGroups(java.lang.Iterable values) { + ensureApiGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiGroups_); + onChanged(); + return this; + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public Builder clearApiGroups() { + apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * APIGroups is the API groups the resources belong to. '*' is all groups.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiGroups = 1; + */ + public Builder addApiGroupsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiGroupsIsMutable(); + apiGroups_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList apiVersions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureApiVersionsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + apiVersions_ = new com.google.protobuf.LazyStringArrayList(apiVersions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public com.google.protobuf.ProtocolStringList getApiVersionsList() { + return apiVersions_.getUnmodifiableView(); + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public int getApiVersionsCount() { + return apiVersions_.size(); + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public java.lang.String getApiVersions(int index) { + return apiVersions_.get(index); + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public com.google.protobuf.ByteString getApiVersionsBytes(int index) { + return apiVersions_.getByteString(index); + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public Builder setApiVersions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiVersionsIsMutable(); + apiVersions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public Builder addApiVersions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiVersionsIsMutable(); + apiVersions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public Builder addAllApiVersions(java.lang.Iterable values) { + ensureApiVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiVersions_); + onChanged(); + return this; + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public Builder clearApiVersions() { + apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * APIVersions is the API versions the resources belong to. '*' is all versions.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string apiVersions = 2; + */ + public Builder addApiVersionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApiVersionsIsMutable(); + apiVersions_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resources_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureResourcesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + resources_ = new com.google.protobuf.LazyStringArrayList(resources_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_.getUnmodifiableView(); + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public int getResourcesCount() { + return resources_.size(); + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public Builder setResources(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public Builder addResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public Builder addAllResources(java.lang.Iterable values) { + ensureResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); + onChanged(); + return this; + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public Builder clearResources() { + resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Resources is a list of resources this rule applies to.
+       *
+       * For example:
+       * 'pods' means pods.
+       * 'pods/log' means the log subresource of pods.
+       * '*' means all resources, but not subresources.
+       * 'pods/*' means all subresources of pods.
+       * '*/scale' means all scale subresources.
+       * '*/*' means all resources and their subresources.
+       *
+       * If wildcard is present, the validation rule will ensure resources do not
+       * overlap with each other.
+       *
+       * Depending on the enclosing object, subresources might not be allowed.
+       * Required.
+       * 
+ * + * repeated string resources = 3; + */ + public Builder addResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + onChanged(); + return this; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.Rule) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.Rule) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RuleWithOperationsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + java.util.List getOperationsList(); + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + int getOperationsCount(); + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + java.lang.String getOperations(int index); + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + com.google.protobuf.ByteString getOperationsBytes(int index); + + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + boolean hasRule(); + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule(); + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRuleOrBuilder(); + } + /** + * + * + *
+   * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
+   * sure that all the tuple expansions are valid.
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations} + */ + public static final class RuleWithOperations extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) + RuleWithOperationsOrBuilder { + private static final long serialVersionUID = 0L; + // Use RuleWithOperations.newBuilder() to construct. + private RuleWithOperations(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RuleWithOperations() { + operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RuleWithOperations( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + operations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + operations_.add(bs); + break; + } + case 18: + { + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder subBuilder = + null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = rule_.toBuilder(); + } + rule_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rule_); + rule_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + operations_ = operations_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + .class); + } + + private int bitField0_; + public static final int OPERATIONS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList operations_; + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + public com.google.protobuf.ProtocolStringList getOperationsList() { + return operations_; + } + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + public int getOperationsCount() { + return operations_.size(); + } + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + public java.lang.String getOperations(int index) { + return operations_.get(index); + } + /** + * + * + *
+     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+     * for all operations.
+     * If '*' is present, the length of the slice must be one.
+     * Required.
+     * 
+ * + * repeated string operations = 1; + */ + public com.google.protobuf.ByteString getOperationsBytes(int index) { + return operations_.getByteString(index); + } + + public static final int RULE_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule rule_; + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public boolean hasRule() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule() { + return rule_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() + : rule_; + } + /** + * + * + *
+     * Rule is embedded, it describes other criteria of the rule, like
+     * APIGroups, APIVersions, Resources, etc.
+     * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder + getRuleOrBuilder() { + return rule_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() + : rule_; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < operations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operations_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(2, getRule()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < operations_.size(); i++) { + dataSize += computeStringSizeNoTag(operations_.getRaw(i)); + } + size += dataSize; + size += 1 * getOperationsList().size(); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRule()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) obj; + + boolean result = true; + result = result && getOperationsList().equals(other.getOperationsList()); + result = result && (hasRule() == other.hasRule()); + if (hasRule()) { + result = result && getRule().equals(other.getRule()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + if (hasRule()) { + hash = (37 * hash) + RULE_FIELD_NUMBER; + hash = (53 * hash) + getRule().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
+     * sure that all the tuple expansions are valid.
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder + .class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuleFieldBuilder(); + } + } + + public Builder clear() { + super.clear(); + operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (ruleBuilder_ == null) { + rule_ = null; + } else { + ruleBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + operations_ = operations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.operations_ = operations_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + if (ruleBuilder_ == null) { + result.rule_ = rule_; + } else { + result.rule_ = ruleBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + .getDefaultInstance()) return this; + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + if (other.hasRule()) { + mergeRule(other.getRule()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList operations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + operations_ = new com.google.protobuf.LazyStringArrayList(operations_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public com.google.protobuf.ProtocolStringList getOperationsList() { + return operations_.getUnmodifiableView(); + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public int getOperationsCount() { + return operations_.size(); + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public java.lang.String getOperations(int index) { + return operations_.get(index); + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public com.google.protobuf.ByteString getOperationsBytes(int index) { + return operations_.getByteString(index); + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public Builder setOperations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public Builder addOperations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public Builder addAllOperations(java.lang.Iterable values) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operations_); + onChanged(); + return this; + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public Builder clearOperations() { + operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
+       * for all operations.
+       * If '*' is present, the length of the slice must be one.
+       * Required.
+       * 
+ * + * repeated string operations = 1; + */ + public Builder addOperationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + return this; + } + + private io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule rule_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + ruleBuilder_; + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public boolean hasRule() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule() { + if (ruleBuilder_ == null) { + return rule_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() + : rule_; + } else { + return ruleBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public Builder setRule(io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { + if (ruleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + ruleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public Builder setRule( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { + if (ruleBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + ruleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public Builder mergeRule( + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { + if (ruleBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && rule_ != null + && rule_ + != io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule + .getDefaultInstance()) { + rule_ = + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.newBuilder(rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + ruleBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public Builder clearRule() { + if (ruleBuilder_ == null) { + rule_ = null; + onChanged(); + } else { + ruleBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder + getRuleBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder + getRuleOrBuilder() { + if (ruleBuilder_ != null) { + return ruleBuilder_.getMessageOrBuilder(); + } else { + return rule_ == null + ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() + : rule_; + } + } + /** + * + * + *
+       * Rule is embedded, it describes other criteria of the rule, like
+       * APIGroups, APIVersions, Resources, etc.
+       * 
+ * + * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + ruleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, + io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, + io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder>( + getRule(), getParentForChildren(), isClean()); + rule_ = null; + } + return ruleBuilder_; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public RuleWithOperations parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RuleWithOperations(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ServiceReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + boolean hasNamespace(); + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + java.lang.String getNamespace(); + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + com.google.protobuf.ByteString getNamespaceBytes(); + + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + boolean hasName(); + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + java.lang.String getName(); + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * ServiceReference holds a reference to Service.legacy.k8s.io
+   * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ServiceReference} + */ + public static final class ServiceReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) + ServiceReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceReference.newBuilder() to construct. + private ServiceReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceReference() { + namespace_ = ""; + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceReference( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + namespace_ = bs; + break; + } + case 18: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + name_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder + .class); + } + + private int bitField0_; + public static final int NAMESPACE_FIELD_NUMBER = 1; + private volatile java.lang.Object namespace_; + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } + } + /** + * + * + *
+     * Namespace is the namespace of the service
+     * Required
+     * 
+ * + * optional string namespace = 1; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name is the name of the service
+     * Required
+     * 
+ * + * optional string name = 2; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespace_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespace_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference other = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) obj; + + boolean result = true; + result = result && (hasNamespace() == other.hasNamespace()); + if (hasNamespace()) { + result = result && getNamespace().equals(other.getNamespace()); + } + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName().equals(other.getName()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNamespace()) { + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + } + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * ServiceReference holds a reference to Service.legacy.k8s.io
+     * 
+ * + * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ServiceReference} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.class, + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder + .class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + public Builder clear() { + super.clear(); + namespace_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration + .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance(); + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference build() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + buildPartial() { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference result = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.namespace_ = namespace_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) { + return mergeFrom( + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference other) { + if (other + == io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + .getDefaultInstance()) return this; + if (other.hasNamespace()) { + bitField0_ |= 0x00000001; + namespace_ = other.namespace_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000002; + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object namespace_ = ""; + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public Builder setNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + namespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public Builder clearNamespace() { + bitField0_ = (bitField0_ & ~0x00000001); + namespace_ = getDefaultInstance().getNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+       * Namespace is the namespace of the service
+       * Required
+       * 
+ * + * optional string namespace = 1; + */ + public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + namespace_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name is the name of the service
+       * Required
+       * 
+ * + * optional string name = 2; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) + private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference(); + } + + public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ServiceReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceReference(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9k8s.io/api/admissionregistration/v1alp" + + "ha1/generated.proto\022)k8s.io.api.admissio" + + "nregistration.v1alpha1\0324k8s.io/apimachin" + + "ery/pkg/apis/meta/v1/generated.proto\032/k8" + + "s.io/apimachinery/pkg/runtime/generated." + + "proto\0326k8s.io/apimachinery/pkg/runtime/s" + + "chema/generated.proto\0323k8s.io/apimachine" + + "ry/pkg/util/intstr/generated.proto\"\214\001\n\031A" + + "dmissionHookClientConfig\022L\n\007service\030\001 \001(" + + "\0132;.k8s.io.api.admissionregistration.v1a", + "lpha1.ServiceReference\022\017\n\007urlPath\030\003 \001(\t\022" + + "\020\n\010caBundle\030\002 \001(\014\"\346\001\n\025ExternalAdmissionH" + + "ook\022\014\n\004name\030\001 \001(\t\022Z\n\014clientConfig\030\002 \001(\0132" + + "D.k8s.io.api.admissionregistration.v1alp" + + "ha1.AdmissionHookClientConfig\022L\n\005rules\030\003" + + " \003(\0132=.k8s.io.api.admissionregistration." + + "v1alpha1.RuleWithOperations\022\025\n\rfailurePo" + + "licy\030\004 \001(\t\"\312\001\n\"ExternalAdmissionHookConf" + + "iguration\022B\n\010metadata\030\001 \001(\01320.k8s.io.api" + + "machinery.pkg.apis.meta.v1.ObjectMeta\022`\n", + "\026externalAdmissionHooks\030\002 \003(\0132@.k8s.io.a" + + "pi.admissionregistration.v1alpha1.Extern" + + "alAdmissionHook\"\310\001\n&ExternalAdmissionHoo" + + "kConfigurationList\022@\n\010metadata\030\001 \001(\0132..k" + + "8s.io.apimachinery.pkg.apis.meta.v1.List" + + "Meta\022\\\n\005items\030\002 \003(\0132M.k8s.io.api.admissi" + + "onregistration.v1alpha1.ExternalAdmissio" + + "nHookConfiguration\"[\n\013Initializer\022\014\n\004nam" + + "e\030\001 \001(\t\022>\n\005rules\030\002 \003(\0132/.k8s.io.api.admi" + + "ssionregistration.v1alpha1.Rule\"\254\001\n\030Init", + "ializerConfiguration\022B\n\010metadata\030\001 \001(\01320" + + ".k8s.io.apimachinery.pkg.apis.meta.v1.Ob" + + "jectMeta\022L\n\014initializers\030\002 \003(\01326.k8s.io." + + "api.admissionregistration.v1alpha1.Initi" + + "alizer\"\264\001\n\034InitializerConfigurationList\022" + + "@\n\010metadata\030\001 \001(\0132..k8s.io.apimachinery." + + "pkg.apis.meta.v1.ListMeta\022R\n\005items\030\002 \003(\013" + + "2C.k8s.io.api.admissionregistration.v1al" + + "pha1.InitializerConfiguration\"A\n\004Rule\022\021\n" + + "\tapiGroups\030\001 \003(\t\022\023\n\013apiVersions\030\002 \003(\t\022\021\n", + "\tresources\030\003 \003(\t\"g\n\022RuleWithOperations\022\022" + + "\n\noperations\030\001 \003(\t\022=\n\004rule\030\002 \001(\0132/.k8s.i" + + "o.api.admissionregistration.v1alpha1.Rul" + + "e\"3\n\020ServiceReference\022\021\n\tnamespace\030\001 \001(\t" + + "\022\014\n\004name\030\002 \001(\tBE\n\032io.kubernetes.client.p" + + "rotoB\035V1alpha1AdmissionregistrationZ\010v1a" + + "lpha1" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.kubernetes.client.proto.Meta.getDescriptor(), + io.kubernetes.client.proto.Runtime.getDescriptor(), + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), + io.kubernetes.client.proto.IntStr.getDescriptor(), + }, + assigner); + internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor, + new java.lang.String[] { + "Service", "UrlPath", "CaBundle", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor, + new java.lang.String[] { + "Name", "ClientConfig", "Rules", "FailurePolicy", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor, + new java.lang.String[] { + "Metadata", "ExternalAdmissionHooks", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor, + new java.lang.String[] { + "Metadata", "Items", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor, + new java.lang.String[] { + "Name", "Rules", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor, + new java.lang.String[] { + "Metadata", "Initializers", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor, + new java.lang.String[] { + "Metadata", "Items", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor, + new java.lang.String[] { + "ApiGroups", "ApiVersions", "Resources", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor, + new java.lang.String[] { + "Operations", "Rule", + }); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor, + new java.lang.String[] { + "Namespace", "Name", + }); + io.kubernetes.client.proto.Meta.getDescriptor(); + io.kubernetes.client.proto.Runtime.getDescriptor(); + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); + io.kubernetes.client.proto.IntStr.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java new file mode 100644 index 0000000000..9b5ee6bb7c --- /dev/null +++ b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java @@ -0,0 +1,5571 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.proto; + +public final class V1alpha1Settings { + private V1alpha1Settings() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface PodPresetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPreset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + boolean hasSpec(); + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec(); + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder(); + } + /** + * + * + *
+   * PodPreset is a policy resource that defines additional runtime
+   * requirements for a Pod.
+   * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPreset} + */ + public static final class PodPreset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPreset) + PodPresetOrBuilder { + private static final long serialVersionUID = 0L; + // Use PodPreset.newBuilder() to construct. + private PodPreset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PodPreset() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PodPreset( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = spec_.toBuilder(); + } + spec_ = + input.readMessage( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spec_); + spec_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int SPEC_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec spec_; + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec() { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() + : spec_; + } + /** + * + * + *
+     * +optional
+     * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder() { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() + : spec_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getSpec()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPreset)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Settings.PodPreset other = + (io.kubernetes.client.proto.V1alpha1Settings.PodPreset) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && (hasSpec() == other.hasSpec()); + if (hasSpec()) { + result = result && getSpec().equals(other.getSpec()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Settings.PodPreset prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * PodPreset is a policy resource that defines additional runtime
+     * requirements for a Pod.
+     * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPreset} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPreset) + io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V1alpha1Settings.PodPreset.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getSpecFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (specBuilder_ == null) { + spec_ = null; + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset build() { + io.kubernetes.client.proto.V1alpha1Settings.PodPreset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset buildPartial() { + io.kubernetes.client.proto.V1alpha1Settings.PodPreset result = + new io.kubernetes.client.proto.V1alpha1Settings.PodPreset(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (specBuilder_ == null) { + result.spec_ = spec_; + } else { + result.spec_ = specBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPreset) { + return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPreset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPreset other) { + if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Settings.PodPreset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Settings.PodPreset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec spec_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder> + specBuilder_; + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public Builder setSpec(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public Builder setSpec( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public Builder mergeSpec(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && spec_ != null + && spec_ + != io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec + .getDefaultInstance()) { + spec_ = + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.newBuilder(spec_) + .mergeFrom(value) + .buildPartial(); + } else { + spec_ = value; + } + onChanged(); + } else { + specBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + spec_ = null; + onChanged(); + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder getSpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+       * +optional
+       * 
+ * + * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPreset) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPreset) + private static final io.kubernetes.client.proto.V1alpha1Settings.PodPreset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPreset(); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PodPreset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PodPreset(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PodPresetListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPresetList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMeta getMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + java.util.List getItemsList(); + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index); + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + int getItemsCount(); + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + java.util.List + getItemsOrBuilderList(); + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder(int index); + } + /** + * + * + *
+   * PodPresetList is a list of PodPreset objects.
+   * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetList} + */ + public static final class PodPresetList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPresetList) + PodPresetListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PodPresetList.newBuilder() to construct. + private PodPresetList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PodPresetList() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PodPresetList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList< + io.kubernetes.client.proto.V1alpha1Settings.PodPreset>(); + mutable_bitField0_ |= 0x00000002; + } + items_.add( + input.readMessage( + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.PARSER, + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ListMeta metadata_; + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + + public static final int ITEMS_FIELD_NUMBER = 2; + private java.util.List items_; + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public java.util.List getItemsList() { + return items_; + } + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+     * Items is a list of schema objects.
+     * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetList)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList other = + (io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && getItemsList().equals(other.getItemsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * PodPresetList is a list of PodPreset objects.
+     * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPresetList) + io.kubernetes.client.proto.V1alpha1Settings.PodPresetListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList build() { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList buildPartial() { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList result = + new io.kubernetes.client.proto.V1alpha1Settings.PodPresetList(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) { + return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPresetList other) { + if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList( + items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPreset, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> + itemsBuilder_; + + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder setItems( + int index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder setItems( + int index, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder addItems(io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder addItems( + int index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder addItems( + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder addItems( + int index, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder addAllItems( + java.lang.Iterable + values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public java.util.List< + ? extends io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()); + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder() + .addBuilder( + index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()); + } + /** + * + * + *
+       * Items is a list of schema objects.
+       * 
+ * + * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPreset, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1alpha1Settings.PodPreset, + io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder>( + items_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPresetList) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPresetList) + private static final io.kubernetes.client.proto.V1alpha1Settings.PodPresetList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPresetList(); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PodPresetList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PodPresetList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PodPresetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPresetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + boolean hasSelector(); + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + io.kubernetes.client.proto.Meta.LabelSelector getSelector(); + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder(); + + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + java.util.List getEnvList(); + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + io.kubernetes.client.proto.V1.EnvVar getEnv(int index); + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + int getEnvCount(); + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + java.util.List getEnvOrBuilderList(); + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index); + + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + java.util.List getEnvFromList(); + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index); + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + int getEnvFromCount(); + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + java.util.List + getEnvFromOrBuilderList(); + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index); + + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + java.util.List getVolumesList(); + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + io.kubernetes.client.proto.V1.Volume getVolumes(int index); + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + int getVolumesCount(); + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + java.util.List + getVolumesOrBuilderList(); + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index); + + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + java.util.List getVolumeMountsList(); + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index); + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + int getVolumeMountsCount(); + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + java.util.List + getVolumeMountsOrBuilderList(); + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder(int index); + } + /** + * + * + *
+   * PodPresetSpec is a description of a pod preset.
+   * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetSpec} + */ + public static final class PodPresetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPresetSpec) + PodPresetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use PodPresetSpec.newBuilder() to construct. + private PodPresetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PodPresetSpec() { + env_ = java.util.Collections.emptyList(); + envFrom_ = java.util.Collections.emptyList(); + volumes_ = java.util.Collections.emptyList(); + volumeMounts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PodPresetSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.LabelSelector.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = selector_.toBuilder(); + } + selector_ = + input.readMessage( + io.kubernetes.client.proto.Meta.LabelSelector.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(selector_); + selector_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + env_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + env_.add( + input.readMessage( + io.kubernetes.client.proto.V1.EnvVar.PARSER, extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + envFrom_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + envFrom_.add( + input.readMessage( + io.kubernetes.client.proto.V1.EnvFromSource.PARSER, extensionRegistry)); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + volumes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + volumes_.add( + input.readMessage( + io.kubernetes.client.proto.V1.Volume.PARSER, extensionRegistry)); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + volumeMounts_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + volumeMounts_.add( + input.readMessage( + io.kubernetes.client.proto.V1.VolumeMount.PARSER, extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + env_ = java.util.Collections.unmodifiableList(env_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + envFrom_ = java.util.Collections.unmodifiableList(envFrom_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + volumes_ = java.util.Collections.unmodifiableList(volumes_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + volumeMounts_ = java.util.Collections.unmodifiableList(volumeMounts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder.class); + } + + private int bitField0_; + public static final int SELECTOR_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.LabelSelector selector_; + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + public boolean hasSelector() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + public io.kubernetes.client.proto.Meta.LabelSelector getSelector() { + return selector_ == null + ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() + : selector_; + } + /** + * + * + *
+     * Selector is a label query over a set of resources, in this case pods.
+     * Required.
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + */ + public io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder() { + return selector_ == null + ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() + : selector_; + } + + public static final int ENV_FIELD_NUMBER = 2; + private java.util.List env_; + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public java.util.List getEnvList() { + return env_; + } + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public java.util.List + getEnvOrBuilderList() { + return env_; + } + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public int getEnvCount() { + return env_.size(); + } + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVar getEnv(int index) { + return env_.get(index); + } + /** + * + * + *
+     * Env defines the collection of EnvVar to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index) { + return env_.get(index); + } + + public static final int ENVFROM_FIELD_NUMBER = 3; + private java.util.List envFrom_; + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public java.util.List getEnvFromList() { + return envFrom_; + } + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public java.util.List + getEnvFromOrBuilderList() { + return envFrom_; + } + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public int getEnvFromCount() { + return envFrom_.size(); + } + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index) { + return envFrom_.get(index); + } + /** + * + * + *
+     * EnvFrom defines the collection of EnvFromSource to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index) { + return envFrom_.get(index); + } + + public static final int VOLUMES_FIELD_NUMBER = 4; + private java.util.List volumes_; + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public java.util.List getVolumesList() { + return volumes_; + } + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public java.util.List + getVolumesOrBuilderList() { + return volumes_; + } + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public int getVolumesCount() { + return volumes_.size(); + } + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.Volume getVolumes(int index) { + return volumes_.get(index); + } + /** + * + * + *
+     * Volumes defines the collection of Volume to inject into the pod.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index) { + return volumes_.get(index); + } + + public static final int VOLUMEMOUNTS_FIELD_NUMBER = 5; + private java.util.List volumeMounts_; + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public java.util.List getVolumeMountsList() { + return volumeMounts_; + } + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public java.util.List + getVolumeMountsOrBuilderList() { + return volumeMounts_; + } + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public int getVolumeMountsCount() { + return volumeMounts_.size(); + } + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index) { + return volumeMounts_.get(index); + } + /** + * + * + *
+     * VolumeMounts defines the collection of VolumeMount to inject into containers.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder(int index) { + return volumeMounts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getSelector()); + } + for (int i = 0; i < env_.size(); i++) { + output.writeMessage(2, env_.get(i)); + } + for (int i = 0; i < envFrom_.size(); i++) { + output.writeMessage(3, envFrom_.get(i)); + } + for (int i = 0; i < volumes_.size(); i++) { + output.writeMessage(4, volumes_.get(i)); + } + for (int i = 0; i < volumeMounts_.size(); i++) { + output.writeMessage(5, volumeMounts_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSelector()); + } + for (int i = 0; i < env_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, env_.get(i)); + } + for (int i = 0; i < envFrom_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, envFrom_.get(i)); + } + for (int i = 0; i < volumes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, volumes_.get(i)); + } + for (int i = 0; i < volumeMounts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, volumeMounts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec other = + (io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) obj; + + boolean result = true; + result = result && (hasSelector() == other.hasSelector()); + if (hasSelector()) { + result = result && getSelector().equals(other.getSelector()); + } + result = result && getEnvList().equals(other.getEnvList()); + result = result && getEnvFromList().equals(other.getEnvFromList()); + result = result && getVolumesList().equals(other.getVolumesList()); + result = result && getVolumeMountsList().equals(other.getVolumeMountsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSelector()) { + hash = (37 * hash) + SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getSelector().hashCode(); + } + if (getEnvCount() > 0) { + hash = (37 * hash) + ENV_FIELD_NUMBER; + hash = (53 * hash) + getEnvList().hashCode(); + } + if (getEnvFromCount() > 0) { + hash = (37 * hash) + ENVFROM_FIELD_NUMBER; + hash = (53 * hash) + getEnvFromList().hashCode(); + } + if (getVolumesCount() > 0) { + hash = (37 * hash) + VOLUMES_FIELD_NUMBER; + hash = (53 * hash) + getVolumesList().hashCode(); + } + if (getVolumeMountsCount() > 0) { + hash = (37 * hash) + VOLUMEMOUNTS_FIELD_NUMBER; + hash = (53 * hash) + getVolumeMountsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * PodPresetSpec is a description of a pod preset.
+     * 
+ * + * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPresetSpec) + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.class, + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder.class); + } + + // Construct using + // io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSelectorFieldBuilder(); + getEnvFieldBuilder(); + getEnvFromFieldBuilder(); + getVolumesFieldBuilder(); + getVolumeMountsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (selectorBuilder_ == null) { + selector_ = null; + } else { + selectorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (envBuilder_ == null) { + env_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + envBuilder_.clear(); + } + if (envFromBuilder_ == null) { + envFrom_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + envFromBuilder_.clear(); + } + if (volumesBuilder_ == null) { + volumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + volumesBuilder_.clear(); + } + if (volumeMountsBuilder_ == null) { + volumeMounts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + volumeMountsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V1alpha1Settings + .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstanceForType() { + return io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec build() { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec buildPartial() { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec result = + new io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (selectorBuilder_ == null) { + result.selector_ = selector_; + } else { + result.selector_ = selectorBuilder_.build(); + } + if (envBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + env_ = java.util.Collections.unmodifiableList(env_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.env_ = env_; + } else { + result.env_ = envBuilder_.build(); + } + if (envFromBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + envFrom_ = java.util.Collections.unmodifiableList(envFrom_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.envFrom_ = envFrom_; + } else { + result.envFrom_ = envFromBuilder_.build(); + } + if (volumesBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + volumes_ = java.util.Collections.unmodifiableList(volumes_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.volumes_ = volumes_; + } else { + result.volumes_ = volumesBuilder_.build(); + } + if (volumeMountsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + volumeMounts_ = java.util.Collections.unmodifiableList(volumeMounts_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.volumeMounts_ = volumeMounts_; + } else { + result.volumeMounts_ = volumeMountsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) { + return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec other) { + if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance()) + return this; + if (other.hasSelector()) { + mergeSelector(other.getSelector()); + } + if (envBuilder_ == null) { + if (!other.env_.isEmpty()) { + if (env_.isEmpty()) { + env_ = other.env_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEnvIsMutable(); + env_.addAll(other.env_); + } + onChanged(); + } + } else { + if (!other.env_.isEmpty()) { + if (envBuilder_.isEmpty()) { + envBuilder_.dispose(); + envBuilder_ = null; + env_ = other.env_; + bitField0_ = (bitField0_ & ~0x00000002); + envBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnvFieldBuilder() + : null; + } else { + envBuilder_.addAllMessages(other.env_); + } + } + } + if (envFromBuilder_ == null) { + if (!other.envFrom_.isEmpty()) { + if (envFrom_.isEmpty()) { + envFrom_ = other.envFrom_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureEnvFromIsMutable(); + envFrom_.addAll(other.envFrom_); + } + onChanged(); + } + } else { + if (!other.envFrom_.isEmpty()) { + if (envFromBuilder_.isEmpty()) { + envFromBuilder_.dispose(); + envFromBuilder_ = null; + envFrom_ = other.envFrom_; + bitField0_ = (bitField0_ & ~0x00000004); + envFromBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnvFromFieldBuilder() + : null; + } else { + envFromBuilder_.addAllMessages(other.envFrom_); + } + } + } + if (volumesBuilder_ == null) { + if (!other.volumes_.isEmpty()) { + if (volumes_.isEmpty()) { + volumes_ = other.volumes_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureVolumesIsMutable(); + volumes_.addAll(other.volumes_); + } + onChanged(); + } + } else { + if (!other.volumes_.isEmpty()) { + if (volumesBuilder_.isEmpty()) { + volumesBuilder_.dispose(); + volumesBuilder_ = null; + volumes_ = other.volumes_; + bitField0_ = (bitField0_ & ~0x00000008); + volumesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVolumesFieldBuilder() + : null; + } else { + volumesBuilder_.addAllMessages(other.volumes_); + } + } + } + if (volumeMountsBuilder_ == null) { + if (!other.volumeMounts_.isEmpty()) { + if (volumeMounts_.isEmpty()) { + volumeMounts_ = other.volumeMounts_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureVolumeMountsIsMutable(); + volumeMounts_.addAll(other.volumeMounts_); + } + onChanged(); + } + } else { + if (!other.volumeMounts_.isEmpty()) { + if (volumeMountsBuilder_.isEmpty()) { + volumeMountsBuilder_.dispose(); + volumeMountsBuilder_ = null; + volumeMounts_ = other.volumeMounts_; + bitField0_ = (bitField0_ & ~0x00000010); + volumeMountsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVolumeMountsFieldBuilder() + : null; + } else { + volumeMountsBuilder_.addAllMessages(other.volumeMounts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.LabelSelector selector_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.LabelSelector, + io.kubernetes.client.proto.Meta.LabelSelector.Builder, + io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder> + selectorBuilder_; + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public boolean hasSelector() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public io.kubernetes.client.proto.Meta.LabelSelector getSelector() { + if (selectorBuilder_ == null) { + return selector_ == null + ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() + : selector_; + } else { + return selectorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public Builder setSelector(io.kubernetes.client.proto.Meta.LabelSelector value) { + if (selectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selector_ = value; + onChanged(); + } else { + selectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public Builder setSelector( + io.kubernetes.client.proto.Meta.LabelSelector.Builder builderForValue) { + if (selectorBuilder_ == null) { + selector_ = builderForValue.build(); + onChanged(); + } else { + selectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public Builder mergeSelector(io.kubernetes.client.proto.Meta.LabelSelector value) { + if (selectorBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && selector_ != null + && selector_ != io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance()) { + selector_ = + io.kubernetes.client.proto.Meta.LabelSelector.newBuilder(selector_) + .mergeFrom(value) + .buildPartial(); + } else { + selector_ = value; + } + onChanged(); + } else { + selectorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public Builder clearSelector() { + if (selectorBuilder_ == null) { + selector_ = null; + onChanged(); + } else { + selectorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public io.kubernetes.client.proto.Meta.LabelSelector.Builder getSelectorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSelectorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + public io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder() { + if (selectorBuilder_ != null) { + return selectorBuilder_.getMessageOrBuilder(); + } else { + return selector_ == null + ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() + : selector_; + } + } + /** + * + * + *
+       * Selector is a label query over a set of resources, in this case pods.
+       * Required.
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.LabelSelector, + io.kubernetes.client.proto.Meta.LabelSelector.Builder, + io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder> + getSelectorFieldBuilder() { + if (selectorBuilder_ == null) { + selectorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.LabelSelector, + io.kubernetes.client.proto.Meta.LabelSelector.Builder, + io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder>( + getSelector(), getParentForChildren(), isClean()); + selector_ = null; + } + return selectorBuilder_; + } + + private java.util.List env_ = + java.util.Collections.emptyList(); + + private void ensureEnvIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + env_ = new java.util.ArrayList(env_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvVar, + io.kubernetes.client.proto.V1.EnvVar.Builder, + io.kubernetes.client.proto.V1.EnvVarOrBuilder> + envBuilder_; + + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public java.util.List getEnvList() { + if (envBuilder_ == null) { + return java.util.Collections.unmodifiableList(env_); + } else { + return envBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public int getEnvCount() { + if (envBuilder_ == null) { + return env_.size(); + } else { + return envBuilder_.getCount(); + } + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVar getEnv(int index) { + if (envBuilder_ == null) { + return env_.get(index); + } else { + return envBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder setEnv(int index, io.kubernetes.client.proto.V1.EnvVar value) { + if (envBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvIsMutable(); + env_.set(index, value); + onChanged(); + } else { + envBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder setEnv( + int index, io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { + if (envBuilder_ == null) { + ensureEnvIsMutable(); + env_.set(index, builderForValue.build()); + onChanged(); + } else { + envBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder addEnv(io.kubernetes.client.proto.V1.EnvVar value) { + if (envBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvIsMutable(); + env_.add(value); + onChanged(); + } else { + envBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder addEnv(int index, io.kubernetes.client.proto.V1.EnvVar value) { + if (envBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvIsMutable(); + env_.add(index, value); + onChanged(); + } else { + envBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder addEnv(io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { + if (envBuilder_ == null) { + ensureEnvIsMutable(); + env_.add(builderForValue.build()); + onChanged(); + } else { + envBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder addEnv( + int index, io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { + if (envBuilder_ == null) { + ensureEnvIsMutable(); + env_.add(index, builderForValue.build()); + onChanged(); + } else { + envBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder addAllEnv( + java.lang.Iterable values) { + if (envBuilder_ == null) { + ensureEnvIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, env_); + onChanged(); + } else { + envBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder clearEnv() { + if (envBuilder_ == null) { + env_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + envBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public Builder removeEnv(int index) { + if (envBuilder_ == null) { + ensureEnvIsMutable(); + env_.remove(index); + onChanged(); + } else { + envBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVar.Builder getEnvBuilder(int index) { + return getEnvFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index) { + if (envBuilder_ == null) { + return env_.get(index); + } else { + return envBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public java.util.List + getEnvOrBuilderList() { + if (envBuilder_ != null) { + return envBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(env_); + } + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVar.Builder addEnvBuilder() { + return getEnvFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1.EnvVar.getDefaultInstance()); + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public io.kubernetes.client.proto.V1.EnvVar.Builder addEnvBuilder(int index) { + return getEnvFieldBuilder() + .addBuilder(index, io.kubernetes.client.proto.V1.EnvVar.getDefaultInstance()); + } + /** + * + * + *
+       * Env defines the collection of EnvVar to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvVar env = 2; + */ + public java.util.List getEnvBuilderList() { + return getEnvFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvVar, + io.kubernetes.client.proto.V1.EnvVar.Builder, + io.kubernetes.client.proto.V1.EnvVarOrBuilder> + getEnvFieldBuilder() { + if (envBuilder_ == null) { + envBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvVar, + io.kubernetes.client.proto.V1.EnvVar.Builder, + io.kubernetes.client.proto.V1.EnvVarOrBuilder>( + env_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + env_ = null; + } + return envBuilder_; + } + + private java.util.List envFrom_ = + java.util.Collections.emptyList(); + + private void ensureEnvFromIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + envFrom_ = new java.util.ArrayList(envFrom_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvFromSource, + io.kubernetes.client.proto.V1.EnvFromSource.Builder, + io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder> + envFromBuilder_; + + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public java.util.List getEnvFromList() { + if (envFromBuilder_ == null) { + return java.util.Collections.unmodifiableList(envFrom_); + } else { + return envFromBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public int getEnvFromCount() { + if (envFromBuilder_ == null) { + return envFrom_.size(); + } else { + return envFromBuilder_.getCount(); + } + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index) { + if (envFromBuilder_ == null) { + return envFrom_.get(index); + } else { + return envFromBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder setEnvFrom(int index, io.kubernetes.client.proto.V1.EnvFromSource value) { + if (envFromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvFromIsMutable(); + envFrom_.set(index, value); + onChanged(); + } else { + envFromBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder setEnvFrom( + int index, io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { + if (envFromBuilder_ == null) { + ensureEnvFromIsMutable(); + envFrom_.set(index, builderForValue.build()); + onChanged(); + } else { + envFromBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder addEnvFrom(io.kubernetes.client.proto.V1.EnvFromSource value) { + if (envFromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvFromIsMutable(); + envFrom_.add(value); + onChanged(); + } else { + envFromBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder addEnvFrom(int index, io.kubernetes.client.proto.V1.EnvFromSource value) { + if (envFromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvFromIsMutable(); + envFrom_.add(index, value); + onChanged(); + } else { + envFromBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder addEnvFrom( + io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { + if (envFromBuilder_ == null) { + ensureEnvFromIsMutable(); + envFrom_.add(builderForValue.build()); + onChanged(); + } else { + envFromBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder addEnvFrom( + int index, io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { + if (envFromBuilder_ == null) { + ensureEnvFromIsMutable(); + envFrom_.add(index, builderForValue.build()); + onChanged(); + } else { + envFromBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder addAllEnvFrom( + java.lang.Iterable values) { + if (envFromBuilder_ == null) { + ensureEnvFromIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, envFrom_); + onChanged(); + } else { + envFromBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder clearEnvFrom() { + if (envFromBuilder_ == null) { + envFrom_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + envFromBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public Builder removeEnvFrom(int index) { + if (envFromBuilder_ == null) { + ensureEnvFromIsMutable(); + envFrom_.remove(index); + onChanged(); + } else { + envFromBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSource.Builder getEnvFromBuilder(int index) { + return getEnvFromFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index) { + if (envFromBuilder_ == null) { + return envFrom_.get(index); + } else { + return envFromBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public java.util.List + getEnvFromOrBuilderList() { + if (envFromBuilder_ != null) { + return envFromBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(envFrom_); + } + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSource.Builder addEnvFromBuilder() { + return getEnvFromFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1.EnvFromSource.getDefaultInstance()); + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public io.kubernetes.client.proto.V1.EnvFromSource.Builder addEnvFromBuilder(int index) { + return getEnvFromFieldBuilder() + .addBuilder(index, io.kubernetes.client.proto.V1.EnvFromSource.getDefaultInstance()); + } + /** + * + * + *
+       * EnvFrom defines the collection of EnvFromSource to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; + */ + public java.util.List + getEnvFromBuilderList() { + return getEnvFromFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvFromSource, + io.kubernetes.client.proto.V1.EnvFromSource.Builder, + io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder> + getEnvFromFieldBuilder() { + if (envFromBuilder_ == null) { + envFromBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.EnvFromSource, + io.kubernetes.client.proto.V1.EnvFromSource.Builder, + io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder>( + envFrom_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + envFrom_ = null; + } + return envFromBuilder_; + } + + private java.util.List volumes_ = + java.util.Collections.emptyList(); + + private void ensureVolumesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + volumes_ = new java.util.ArrayList(volumes_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.Volume, + io.kubernetes.client.proto.V1.Volume.Builder, + io.kubernetes.client.proto.V1.VolumeOrBuilder> + volumesBuilder_; + + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public java.util.List getVolumesList() { + if (volumesBuilder_ == null) { + return java.util.Collections.unmodifiableList(volumes_); + } else { + return volumesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public int getVolumesCount() { + if (volumesBuilder_ == null) { + return volumes_.size(); + } else { + return volumesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.Volume getVolumes(int index) { + if (volumesBuilder_ == null) { + return volumes_.get(index); + } else { + return volumesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder setVolumes(int index, io.kubernetes.client.proto.V1.Volume value) { + if (volumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumesIsMutable(); + volumes_.set(index, value); + onChanged(); + } else { + volumesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder setVolumes( + int index, io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { + if (volumesBuilder_ == null) { + ensureVolumesIsMutable(); + volumes_.set(index, builderForValue.build()); + onChanged(); + } else { + volumesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder addVolumes(io.kubernetes.client.proto.V1.Volume value) { + if (volumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumesIsMutable(); + volumes_.add(value); + onChanged(); + } else { + volumesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder addVolumes(int index, io.kubernetes.client.proto.V1.Volume value) { + if (volumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumesIsMutable(); + volumes_.add(index, value); + onChanged(); + } else { + volumesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder addVolumes(io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { + if (volumesBuilder_ == null) { + ensureVolumesIsMutable(); + volumes_.add(builderForValue.build()); + onChanged(); + } else { + volumesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder addVolumes( + int index, io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { + if (volumesBuilder_ == null) { + ensureVolumesIsMutable(); + volumes_.add(index, builderForValue.build()); + onChanged(); + } else { + volumesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder addAllVolumes( + java.lang.Iterable values) { + if (volumesBuilder_ == null) { + ensureVolumesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumes_); + onChanged(); + } else { + volumesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder clearVolumes() { + if (volumesBuilder_ == null) { + volumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + volumesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public Builder removeVolumes(int index) { + if (volumesBuilder_ == null) { + ensureVolumesIsMutable(); + volumes_.remove(index); + onChanged(); + } else { + volumesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.Volume.Builder getVolumesBuilder(int index) { + return getVolumesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index) { + if (volumesBuilder_ == null) { + return volumes_.get(index); + } else { + return volumesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public java.util.List + getVolumesOrBuilderList() { + if (volumesBuilder_ != null) { + return volumesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(volumes_); + } + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.Volume.Builder addVolumesBuilder() { + return getVolumesFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1.Volume.getDefaultInstance()); + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public io.kubernetes.client.proto.V1.Volume.Builder addVolumesBuilder(int index) { + return getVolumesFieldBuilder() + .addBuilder(index, io.kubernetes.client.proto.V1.Volume.getDefaultInstance()); + } + /** + * + * + *
+       * Volumes defines the collection of Volume to inject into the pod.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.Volume volumes = 4; + */ + public java.util.List getVolumesBuilderList() { + return getVolumesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.Volume, + io.kubernetes.client.proto.V1.Volume.Builder, + io.kubernetes.client.proto.V1.VolumeOrBuilder> + getVolumesFieldBuilder() { + if (volumesBuilder_ == null) { + volumesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.Volume, + io.kubernetes.client.proto.V1.Volume.Builder, + io.kubernetes.client.proto.V1.VolumeOrBuilder>( + volumes_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + volumes_ = null; + } + return volumesBuilder_; + } + + private java.util.List volumeMounts_ = + java.util.Collections.emptyList(); + + private void ensureVolumeMountsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + volumeMounts_ = + new java.util.ArrayList(volumeMounts_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.VolumeMount, + io.kubernetes.client.proto.V1.VolumeMount.Builder, + io.kubernetes.client.proto.V1.VolumeMountOrBuilder> + volumeMountsBuilder_; + + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public java.util.List getVolumeMountsList() { + if (volumeMountsBuilder_ == null) { + return java.util.Collections.unmodifiableList(volumeMounts_); + } else { + return volumeMountsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public int getVolumeMountsCount() { + if (volumeMountsBuilder_ == null) { + return volumeMounts_.size(); + } else { + return volumeMountsBuilder_.getCount(); + } + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index) { + if (volumeMountsBuilder_ == null) { + return volumeMounts_.get(index); + } else { + return volumeMountsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder setVolumeMounts(int index, io.kubernetes.client.proto.V1.VolumeMount value) { + if (volumeMountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumeMountsIsMutable(); + volumeMounts_.set(index, value); + onChanged(); + } else { + volumeMountsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder setVolumeMounts( + int index, io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { + if (volumeMountsBuilder_ == null) { + ensureVolumeMountsIsMutable(); + volumeMounts_.set(index, builderForValue.build()); + onChanged(); + } else { + volumeMountsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder addVolumeMounts(io.kubernetes.client.proto.V1.VolumeMount value) { + if (volumeMountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumeMountsIsMutable(); + volumeMounts_.add(value); + onChanged(); + } else { + volumeMountsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder addVolumeMounts(int index, io.kubernetes.client.proto.V1.VolumeMount value) { + if (volumeMountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumeMountsIsMutable(); + volumeMounts_.add(index, value); + onChanged(); + } else { + volumeMountsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder addVolumeMounts( + io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { + if (volumeMountsBuilder_ == null) { + ensureVolumeMountsIsMutable(); + volumeMounts_.add(builderForValue.build()); + onChanged(); + } else { + volumeMountsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder addVolumeMounts( + int index, io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { + if (volumeMountsBuilder_ == null) { + ensureVolumeMountsIsMutable(); + volumeMounts_.add(index, builderForValue.build()); + onChanged(); + } else { + volumeMountsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder addAllVolumeMounts( + java.lang.Iterable values) { + if (volumeMountsBuilder_ == null) { + ensureVolumeMountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumeMounts_); + onChanged(); + } else { + volumeMountsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder clearVolumeMounts() { + if (volumeMountsBuilder_ == null) { + volumeMounts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + volumeMountsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public Builder removeVolumeMounts(int index) { + if (volumeMountsBuilder_ == null) { + ensureVolumeMountsIsMutable(); + volumeMounts_.remove(index); + onChanged(); + } else { + volumeMountsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMount.Builder getVolumeMountsBuilder(int index) { + return getVolumeMountsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder( + int index) { + if (volumeMountsBuilder_ == null) { + return volumeMounts_.get(index); + } else { + return volumeMountsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public java.util.List + getVolumeMountsOrBuilderList() { + if (volumeMountsBuilder_ != null) { + return volumeMountsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(volumeMounts_); + } + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMount.Builder addVolumeMountsBuilder() { + return getVolumeMountsFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1.VolumeMount.getDefaultInstance()); + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public io.kubernetes.client.proto.V1.VolumeMount.Builder addVolumeMountsBuilder(int index) { + return getVolumeMountsFieldBuilder() + .addBuilder(index, io.kubernetes.client.proto.V1.VolumeMount.getDefaultInstance()); + } + /** + * + * + *
+       * VolumeMounts defines the collection of VolumeMount to inject into containers.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; + */ + public java.util.List + getVolumeMountsBuilderList() { + return getVolumeMountsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.VolumeMount, + io.kubernetes.client.proto.V1.VolumeMount.Builder, + io.kubernetes.client.proto.V1.VolumeMountOrBuilder> + getVolumeMountsFieldBuilder() { + if (volumeMountsBuilder_ == null) { + volumeMountsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.VolumeMount, + io.kubernetes.client.proto.V1.VolumeMount.Builder, + io.kubernetes.client.proto.V1.VolumeMountOrBuilder>( + volumeMounts_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + volumeMounts_ = null; + } + return volumeMountsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPresetSpec) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPresetSpec) + private static final io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec(); + } + + public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PodPresetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PodPresetSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,k8s.io/api/settings/v1alpha1/generated" + + ".proto\022\034k8s.io.api.settings.v1alpha1\032\"k8" + + "s.io/api/core/v1/generated.proto\0324k8s.io" + + "/apimachinery/pkg/apis/meta/v1/generated" + + ".proto\032/k8s.io/apimachinery/pkg/runtime/" + + "generated.proto\0326k8s.io/apimachinery/pkg" + + "/runtime/schema/generated.proto\"\212\001\n\tPodP" + + "reset\022B\n\010metadata\030\001 \001(\01320.k8s.io.apimach" + + "inery.pkg.apis.meta.v1.ObjectMeta\0229\n\004spe" + + "c\030\002 \001(\0132+.k8s.io.api.settings.v1alpha1.P" + + "odPresetSpec\"\211\001\n\rPodPresetList\022@\n\010metada" + + "ta\030\001 \001(\0132..k8s.io.apimachinery.pkg.apis." + + "meta.v1.ListMeta\0226\n\005items\030\002 \003(\0132\'.k8s.io" + + ".api.settings.v1alpha1.PodPreset\"\227\002\n\rPod" + + "PresetSpec\022E\n\010selector\030\001 \001(\01323.k8s.io.ap" + + "imachinery.pkg.apis.meta.v1.LabelSelecto" + + "r\022\'\n\003env\030\002 \003(\0132\032.k8s.io.api.core.v1.EnvV" + + "ar\0222\n\007envFrom\030\003 \003(\0132!.k8s.io.api.core.v1" + + ".EnvFromSource\022+\n\007volumes\030\004 \003(\0132\032.k8s.io" + + ".api.core.v1.Volume\0225\n\014volumeMounts\030\005 \003(" + + "\0132\037.k8s.io.api.core.v1.VolumeMountB8\n\032io" + + ".kubernetes.client.protoB\020V1alpha1Settin" + + "gsZ\010v1alpha1" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.kubernetes.client.proto.V1.getDescriptor(), + io.kubernetes.client.proto.Meta.getDescriptor(), + io.kubernetes.client.proto.Runtime.getDescriptor(), + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), + }, + assigner); + internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor, + new java.lang.String[] { + "Metadata", "Spec", + }); + internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor, + new java.lang.String[] { + "Metadata", "Items", + }); + internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor, + new java.lang.String[] { + "Selector", "Env", "EnvFrom", "Volumes", "VolumeMounts", + }); + io.kubernetes.client.proto.V1.getDescriptor(); + io.kubernetes.client.proto.Meta.getDescriptor(); + io.kubernetes.client.proto.Runtime.getDescriptor(); + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java b/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java new file mode 100644 index 0000000000..8f74e03ff4 --- /dev/null +++ b/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java @@ -0,0 +1,8443 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.proto; + +public final class V2alpha1Batch { + private V2alpha1Batch() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface CronJobOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJob) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + boolean hasSpec(); + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec(); + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + boolean hasStatus(); + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus(); + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder(); + } + /** + * + * + *
+   * CronJob represents the configuration of a single cron job.
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJob} + */ + public static final class CronJob extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJob) + CronJobOrBuilder { + private static final long serialVersionUID = 0L; + // Use CronJob.newBuilder() to construct. + private CronJob(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CronJob() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CronJob( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = spec_.toBuilder(); + } + spec_ = + input.readMessage( + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spec_); + spec_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: + { + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = status_.toBuilder(); + } + status_ = + input.readMessage( + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJob.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int SPEC_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec spec_; + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec() { + return spec_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() + : spec_; + } + /** + * + * + *
+     * Specification of the desired behavior of a cron job, including the schedule.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder() { + return spec_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() + : spec_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus status_; + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus() { + return status_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() + : status_; + } + /** + * + * + *
+     * Current status of a cron job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder() { + return status_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() + : status_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getSpec()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJob)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.CronJob other = + (io.kubernetes.client.proto.V2alpha1Batch.CronJob) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && (hasSpec() == other.hasSpec()); + if (hasSpec()) { + result = result && getSpec().equals(other.getSpec()); + } + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && getStatus().equals(other.getStatus()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.kubernetes.client.proto.V2alpha1Batch.CronJob prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * CronJob represents the configuration of a single cron job.
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJob} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJob) + io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJob.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJob.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getSpecFieldBuilder(); + getStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (specBuilder_ == null) { + spec_ = null; + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (statusBuilder_ == null) { + status_ = null; + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJob build() { + io.kubernetes.client.proto.V2alpha1Batch.CronJob result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJob buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.CronJob result = + new io.kubernetes.client.proto.V2alpha1Batch.CronJob(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (specBuilder_ == null) { + result.spec_ = spec_; + } else { + result.spec_ = specBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJob) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJob) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJob other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.CronJob parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.CronJob) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec spec_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder> + specBuilder_; + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public Builder setSpec(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public Builder setSpec( + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public Builder mergeSpec(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && spec_ != null + && spec_ + != io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance()) { + spec_ = + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.newBuilder(spec_) + .mergeFrom(value) + .buildPartial(); + } else { + spec_ = value; + } + onChanged(); + } else { + specBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + spec_ = null; + onChanged(); + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder getSpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+       * Specification of the desired behavior of a cron job, including the schedule.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + private io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus status_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder> + statusBuilder_; + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public Builder setStatus(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public Builder setStatus( + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public Builder mergeStatus(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) + && status_ != null + && status_ + != io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance()) { + status_ = + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.newBuilder(status_) + .mergeFrom(value) + .buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + statusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() + : status_; + } + } + /** + * + * + *
+       * Current status of a cron job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJob) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJob) + private static final io.kubernetes.client.proto.V2alpha1Batch.CronJob DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJob(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CronJob parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CronJob(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CronJobListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMeta getMetadata(); + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + java.util.List getItemsList(); + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index); + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + int getItemsCount(); + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + java.util.List + getItemsOrBuilderList(); + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder(int index); + } + /** + * + * + *
+   * CronJobList is a collection of cron jobs.
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobList} + */ + public static final class CronJobList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobList) + CronJobListOrBuilder { + private static final long serialVersionUID = 0L; + // Use CronJobList.newBuilder() to construct. + private CronJobList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CronJobList() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CronJobList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + items_.add( + input.readMessage( + io.kubernetes.client.proto.V2alpha1Batch.CronJob.PARSER, + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobList.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobList.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ListMeta metadata_; + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard list metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + + public static final int ITEMS_FIELD_NUMBER = 2; + private java.util.List items_; + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public java.util.List getItemsList() { + return items_; + } + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public int getItemsCount() { + return items_.size(); + } + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index) { + return items_.get(index); + } + /** + * + * + *
+     * items is the list of CronJobs.
+     * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder(int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(2, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobList)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.CronJobList other = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobList) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && getItemsList().equals(other.getItemsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V2alpha1Batch.CronJobList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * CronJobList is a collection of cron jobs.
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobList) + io.kubernetes.client.proto.V2alpha1Batch.CronJobListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobList.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobList.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.CronJobList.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobList build() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobList buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobList result = + new io.kubernetes.client.proto.V2alpha1Batch.CronJobList(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobList) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobList other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobList.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000002); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemsFieldBuilder() + : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.CronJobList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard list metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ListMeta, + io.kubernetes.client.proto.Meta.ListMeta.Builder, + io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + items_ = + new java.util.ArrayList(items_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJob, + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder> + itemsBuilder_; + + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder setItems(int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder setItems( + int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder addItems(io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder addItems(int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder addItems( + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder addItems( + int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder getItemsBuilder(int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder addItemsBuilder() { + return getItemsFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()); + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder addItemsBuilder(int index) { + return getItemsFieldBuilder() + .addBuilder( + index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()); + } + /** + * + * + *
+       * items is the list of CronJobs.
+       * 
+ * + * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJob, + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.CronJob, + io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, + io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder>( + items_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobList) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobList) + private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobList(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CronJobList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CronJobList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CronJobSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + boolean hasSchedule(); + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + java.lang.String getSchedule(); + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + com.google.protobuf.ByteString getScheduleBytes(); + + /** + * + * + *
+     * Optional deadline in seconds for starting the job if it misses scheduled
+     * time for any reason.  Missed jobs executions will be counted as failed ones.
+     * +optional
+     * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + boolean hasStartingDeadlineSeconds(); + /** + * + * + *
+     * Optional deadline in seconds for starting the job if it misses scheduled
+     * time for any reason.  Missed jobs executions will be counted as failed ones.
+     * +optional
+     * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + long getStartingDeadlineSeconds(); + + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + boolean hasConcurrencyPolicy(); + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + java.lang.String getConcurrencyPolicy(); + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + com.google.protobuf.ByteString getConcurrencyPolicyBytes(); + + /** + * + * + *
+     * This flag tells the controller to suspend subsequent executions, it does
+     * not apply to already started executions.  Defaults to false.
+     * +optional
+     * 
+ * + * optional bool suspend = 4; + */ + boolean hasSuspend(); + /** + * + * + *
+     * This flag tells the controller to suspend subsequent executions, it does
+     * not apply to already started executions.  Defaults to false.
+     * +optional
+     * 
+ * + * optional bool suspend = 4; + */ + boolean getSuspend(); + + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + boolean hasJobTemplate(); + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate(); + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder getJobTemplateOrBuilder(); + + /** + * + * + *
+     * The number of successful finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + boolean hasSuccessfulJobsHistoryLimit(); + /** + * + * + *
+     * The number of successful finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + int getSuccessfulJobsHistoryLimit(); + + /** + * + * + *
+     * The number of failed finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + boolean hasFailedJobsHistoryLimit(); + /** + * + * + *
+     * The number of failed finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + int getFailedJobsHistoryLimit(); + } + /** + * + * + *
+   * CronJobSpec describes how the job execution will look like and when it will actually run.
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobSpec} + */ + public static final class CronJobSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobSpec) + CronJobSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use CronJobSpec.newBuilder() to construct. + private CronJobSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CronJobSpec() { + schedule_ = ""; + startingDeadlineSeconds_ = 0L; + concurrencyPolicy_ = ""; + suspend_ = false; + successfulJobsHistoryLimit_ = 0; + failedJobsHistoryLimit_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CronJobSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + schedule_ = bs; + break; + } + case 16: + { + bitField0_ |= 0x00000002; + startingDeadlineSeconds_ = input.readInt64(); + break; + } + case 26: + { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + concurrencyPolicy_ = bs; + break; + } + case 32: + { + bitField0_ |= 0x00000008; + suspend_ = input.readBool(); + break; + } + case 42: + { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = jobTemplate_.toBuilder(); + } + jobTemplate_ = + input.readMessage( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(jobTemplate_); + jobTemplate_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 48: + { + bitField0_ |= 0x00000020; + successfulJobsHistoryLimit_ = input.readInt32(); + break; + } + case 56: + { + bitField0_ |= 0x00000040; + failedJobsHistoryLimit_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder.class); + } + + private int bitField0_; + public static final int SCHEDULE_FIELD_NUMBER = 1; + private volatile java.lang.Object schedule_; + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + public boolean hasSchedule() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + public java.lang.String getSchedule() { + java.lang.Object ref = schedule_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schedule_ = s; + } + return s; + } + } + /** + * + * + *
+     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+     * 
+ * + * optional string schedule = 1; + */ + public com.google.protobuf.ByteString getScheduleBytes() { + java.lang.Object ref = schedule_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schedule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STARTINGDEADLINESECONDS_FIELD_NUMBER = 2; + private long startingDeadlineSeconds_; + /** + * + * + *
+     * Optional deadline in seconds for starting the job if it misses scheduled
+     * time for any reason.  Missed jobs executions will be counted as failed ones.
+     * +optional
+     * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public boolean hasStartingDeadlineSeconds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Optional deadline in seconds for starting the job if it misses scheduled
+     * time for any reason.  Missed jobs executions will be counted as failed ones.
+     * +optional
+     * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public long getStartingDeadlineSeconds() { + return startingDeadlineSeconds_; + } + + public static final int CONCURRENCYPOLICY_FIELD_NUMBER = 3; + private volatile java.lang.Object concurrencyPolicy_; + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + public boolean hasConcurrencyPolicy() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + public java.lang.String getConcurrencyPolicy() { + java.lang.Object ref = concurrencyPolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + concurrencyPolicy_ = s; + } + return s; + } + } + /** + * + * + *
+     * Specifies how to treat concurrent executions of a Job.
+     * Valid values are:
+     * - "Allow" (default): allows CronJobs to run concurrently;
+     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+     * - "Replace": cancels currently running job and replaces it with a new one
+     * +optional
+     * 
+ * + * optional string concurrencyPolicy = 3; + */ + public com.google.protobuf.ByteString getConcurrencyPolicyBytes() { + java.lang.Object ref = concurrencyPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + concurrencyPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUSPEND_FIELD_NUMBER = 4; + private boolean suspend_; + /** + * + * + *
+     * This flag tells the controller to suspend subsequent executions, it does
+     * not apply to already started executions.  Defaults to false.
+     * +optional
+     * 
+ * + * optional bool suspend = 4; + */ + public boolean hasSuspend() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * + * + *
+     * This flag tells the controller to suspend subsequent executions, it does
+     * not apply to already started executions.  Defaults to false.
+     * +optional
+     * 
+ * + * optional bool suspend = 4; + */ + public boolean getSuspend() { + return suspend_; + } + + public static final int JOBTEMPLATE_FIELD_NUMBER = 5; + private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec jobTemplate_; + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public boolean hasJobTemplate() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate() { + return jobTemplate_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : jobTemplate_; + } + /** + * + * + *
+     * Specifies the job that will be created when executing a CronJob.
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder + getJobTemplateOrBuilder() { + return jobTemplate_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : jobTemplate_; + } + + public static final int SUCCESSFULJOBSHISTORYLIMIT_FIELD_NUMBER = 6; + private int successfulJobsHistoryLimit_; + /** + * + * + *
+     * The number of successful finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public boolean hasSuccessfulJobsHistoryLimit() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * + * + *
+     * The number of successful finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public int getSuccessfulJobsHistoryLimit() { + return successfulJobsHistoryLimit_; + } + + public static final int FAILEDJOBSHISTORYLIMIT_FIELD_NUMBER = 7; + private int failedJobsHistoryLimit_; + /** + * + * + *
+     * The number of failed finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public boolean hasFailedJobsHistoryLimit() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * + * + *
+     * The number of failed finished jobs to retain.
+     * This is a pointer to distinguish between explicit zero and not specified.
+     * +optional
+     * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public int getFailedJobsHistoryLimit() { + return failedJobsHistoryLimit_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schedule_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, startingDeadlineSeconds_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, concurrencyPolicy_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(4, suspend_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(5, getJobTemplate()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, successfulJobsHistoryLimit_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, failedJobsHistoryLimit_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schedule_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, startingDeadlineSeconds_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, concurrencyPolicy_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, suspend_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getJobTemplate()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(6, successfulJobsHistoryLimit_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, failedJobsHistoryLimit_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec other = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) obj; + + boolean result = true; + result = result && (hasSchedule() == other.hasSchedule()); + if (hasSchedule()) { + result = result && getSchedule().equals(other.getSchedule()); + } + result = result && (hasStartingDeadlineSeconds() == other.hasStartingDeadlineSeconds()); + if (hasStartingDeadlineSeconds()) { + result = result && (getStartingDeadlineSeconds() == other.getStartingDeadlineSeconds()); + } + result = result && (hasConcurrencyPolicy() == other.hasConcurrencyPolicy()); + if (hasConcurrencyPolicy()) { + result = result && getConcurrencyPolicy().equals(other.getConcurrencyPolicy()); + } + result = result && (hasSuspend() == other.hasSuspend()); + if (hasSuspend()) { + result = result && (getSuspend() == other.getSuspend()); + } + result = result && (hasJobTemplate() == other.hasJobTemplate()); + if (hasJobTemplate()) { + result = result && getJobTemplate().equals(other.getJobTemplate()); + } + result = result && (hasSuccessfulJobsHistoryLimit() == other.hasSuccessfulJobsHistoryLimit()); + if (hasSuccessfulJobsHistoryLimit()) { + result = + result && (getSuccessfulJobsHistoryLimit() == other.getSuccessfulJobsHistoryLimit()); + } + result = result && (hasFailedJobsHistoryLimit() == other.hasFailedJobsHistoryLimit()); + if (hasFailedJobsHistoryLimit()) { + result = result && (getFailedJobsHistoryLimit() == other.getFailedJobsHistoryLimit()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSchedule()) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().hashCode(); + } + if (hasStartingDeadlineSeconds()) { + hash = (37 * hash) + STARTINGDEADLINESECONDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStartingDeadlineSeconds()); + } + if (hasConcurrencyPolicy()) { + hash = (37 * hash) + CONCURRENCYPOLICY_FIELD_NUMBER; + hash = (53 * hash) + getConcurrencyPolicy().hashCode(); + } + if (hasSuspend()) { + hash = (37 * hash) + SUSPEND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSuspend()); + } + if (hasJobTemplate()) { + hash = (37 * hash) + JOBTEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getJobTemplate().hashCode(); + } + if (hasSuccessfulJobsHistoryLimit()) { + hash = (37 * hash) + SUCCESSFULJOBSHISTORYLIMIT_FIELD_NUMBER; + hash = (53 * hash) + getSuccessfulJobsHistoryLimit(); + } + if (hasFailedJobsHistoryLimit()) { + hash = (37 * hash) + FAILEDJOBSHISTORYLIMIT_FIELD_NUMBER; + hash = (53 * hash) + getFailedJobsHistoryLimit(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * CronJobSpec describes how the job execution will look like and when it will actually run.
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobSpec) + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getJobTemplateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + schedule_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + startingDeadlineSeconds_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + concurrencyPolicy_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + suspend_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + if (jobTemplateBuilder_ == null) { + jobTemplate_ = null; + } else { + jobTemplateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + successfulJobsHistoryLimit_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + failedJobsHistoryLimit_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec build() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec result = + new io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.schedule_ = schedule_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.startingDeadlineSeconds_ = startingDeadlineSeconds_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.concurrencyPolicy_ = concurrencyPolicy_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.suspend_ = suspend_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + if (jobTemplateBuilder_ == null) { + result.jobTemplate_ = jobTemplate_; + } else { + result.jobTemplate_ = jobTemplateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.successfulJobsHistoryLimit_ = successfulJobsHistoryLimit_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.failedJobsHistoryLimit_ = failedJobsHistoryLimit_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance()) + return this; + if (other.hasSchedule()) { + bitField0_ |= 0x00000001; + schedule_ = other.schedule_; + onChanged(); + } + if (other.hasStartingDeadlineSeconds()) { + setStartingDeadlineSeconds(other.getStartingDeadlineSeconds()); + } + if (other.hasConcurrencyPolicy()) { + bitField0_ |= 0x00000004; + concurrencyPolicy_ = other.concurrencyPolicy_; + onChanged(); + } + if (other.hasSuspend()) { + setSuspend(other.getSuspend()); + } + if (other.hasJobTemplate()) { + mergeJobTemplate(other.getJobTemplate()); + } + if (other.hasSuccessfulJobsHistoryLimit()) { + setSuccessfulJobsHistoryLimit(other.getSuccessfulJobsHistoryLimit()); + } + if (other.hasFailedJobsHistoryLimit()) { + setFailedJobsHistoryLimit(other.getFailedJobsHistoryLimit()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object schedule_ = ""; + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public boolean hasSchedule() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public java.lang.String getSchedule() { + java.lang.Object ref = schedule_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schedule_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public com.google.protobuf.ByteString getScheduleBytes() { + java.lang.Object ref = schedule_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schedule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public Builder setSchedule(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + schedule_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public Builder clearSchedule() { + bitField0_ = (bitField0_ & ~0x00000001); + schedule_ = getDefaultInstance().getSchedule(); + onChanged(); + return this; + } + /** + * + * + *
+       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
+       * 
+ * + * optional string schedule = 1; + */ + public Builder setScheduleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + schedule_ = value; + onChanged(); + return this; + } + + private long startingDeadlineSeconds_; + /** + * + * + *
+       * Optional deadline in seconds for starting the job if it misses scheduled
+       * time for any reason.  Missed jobs executions will be counted as failed ones.
+       * +optional
+       * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public boolean hasStartingDeadlineSeconds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Optional deadline in seconds for starting the job if it misses scheduled
+       * time for any reason.  Missed jobs executions will be counted as failed ones.
+       * +optional
+       * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public long getStartingDeadlineSeconds() { + return startingDeadlineSeconds_; + } + /** + * + * + *
+       * Optional deadline in seconds for starting the job if it misses scheduled
+       * time for any reason.  Missed jobs executions will be counted as failed ones.
+       * +optional
+       * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public Builder setStartingDeadlineSeconds(long value) { + bitField0_ |= 0x00000002; + startingDeadlineSeconds_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional deadline in seconds for starting the job if it misses scheduled
+       * time for any reason.  Missed jobs executions will be counted as failed ones.
+       * +optional
+       * 
+ * + * optional int64 startingDeadlineSeconds = 2; + */ + public Builder clearStartingDeadlineSeconds() { + bitField0_ = (bitField0_ & ~0x00000002); + startingDeadlineSeconds_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object concurrencyPolicy_ = ""; + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public boolean hasConcurrencyPolicy() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public java.lang.String getConcurrencyPolicy() { + java.lang.Object ref = concurrencyPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + concurrencyPolicy_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public com.google.protobuf.ByteString getConcurrencyPolicyBytes() { + java.lang.Object ref = concurrencyPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + concurrencyPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public Builder setConcurrencyPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + concurrencyPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public Builder clearConcurrencyPolicy() { + bitField0_ = (bitField0_ & ~0x00000004); + concurrencyPolicy_ = getDefaultInstance().getConcurrencyPolicy(); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies how to treat concurrent executions of a Job.
+       * Valid values are:
+       * - "Allow" (default): allows CronJobs to run concurrently;
+       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+       * - "Replace": cancels currently running job and replaces it with a new one
+       * +optional
+       * 
+ * + * optional string concurrencyPolicy = 3; + */ + public Builder setConcurrencyPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + concurrencyPolicy_ = value; + onChanged(); + return this; + } + + private boolean suspend_; + /** + * + * + *
+       * This flag tells the controller to suspend subsequent executions, it does
+       * not apply to already started executions.  Defaults to false.
+       * +optional
+       * 
+ * + * optional bool suspend = 4; + */ + public boolean hasSuspend() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * + * + *
+       * This flag tells the controller to suspend subsequent executions, it does
+       * not apply to already started executions.  Defaults to false.
+       * +optional
+       * 
+ * + * optional bool suspend = 4; + */ + public boolean getSuspend() { + return suspend_; + } + /** + * + * + *
+       * This flag tells the controller to suspend subsequent executions, it does
+       * not apply to already started executions.  Defaults to false.
+       * +optional
+       * 
+ * + * optional bool suspend = 4; + */ + public Builder setSuspend(boolean value) { + bitField0_ |= 0x00000008; + suspend_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * This flag tells the controller to suspend subsequent executions, it does
+       * not apply to already started executions.  Defaults to false.
+       * +optional
+       * 
+ * + * optional bool suspend = 4; + */ + public Builder clearSuspend() { + bitField0_ = (bitField0_ & ~0x00000008); + suspend_ = false; + onChanged(); + return this; + } + + private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec jobTemplate_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> + jobTemplateBuilder_; + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public boolean hasJobTemplate() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate() { + if (jobTemplateBuilder_ == null) { + return jobTemplate_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : jobTemplate_; + } else { + return jobTemplateBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public Builder setJobTemplate( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { + if (jobTemplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + jobTemplate_ = value; + onChanged(); + } else { + jobTemplateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public Builder setJobTemplate( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder builderForValue) { + if (jobTemplateBuilder_ == null) { + jobTemplate_ = builderForValue.build(); + onChanged(); + } else { + jobTemplateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public Builder mergeJobTemplate( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { + if (jobTemplateBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010) + && jobTemplate_ != null + && jobTemplate_ + != io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec + .getDefaultInstance()) { + jobTemplate_ = + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder(jobTemplate_) + .mergeFrom(value) + .buildPartial(); + } else { + jobTemplate_ = value; + } + onChanged(); + } else { + jobTemplateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public Builder clearJobTemplate() { + if (jobTemplateBuilder_ == null) { + jobTemplate_ = null; + onChanged(); + } else { + jobTemplateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder + getJobTemplateBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getJobTemplateFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder + getJobTemplateOrBuilder() { + if (jobTemplateBuilder_ != null) { + return jobTemplateBuilder_.getMessageOrBuilder(); + } else { + return jobTemplate_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : jobTemplate_; + } + } + /** + * + * + *
+       * Specifies the job that will be created when executing a CronJob.
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> + getJobTemplateFieldBuilder() { + if (jobTemplateBuilder_ == null) { + jobTemplateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder>( + getJobTemplate(), getParentForChildren(), isClean()); + jobTemplate_ = null; + } + return jobTemplateBuilder_; + } + + private int successfulJobsHistoryLimit_; + /** + * + * + *
+       * The number of successful finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public boolean hasSuccessfulJobsHistoryLimit() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * + * + *
+       * The number of successful finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public int getSuccessfulJobsHistoryLimit() { + return successfulJobsHistoryLimit_; + } + /** + * + * + *
+       * The number of successful finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public Builder setSuccessfulJobsHistoryLimit(int value) { + bitField0_ |= 0x00000020; + successfulJobsHistoryLimit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of successful finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 successfulJobsHistoryLimit = 6; + */ + public Builder clearSuccessfulJobsHistoryLimit() { + bitField0_ = (bitField0_ & ~0x00000020); + successfulJobsHistoryLimit_ = 0; + onChanged(); + return this; + } + + private int failedJobsHistoryLimit_; + /** + * + * + *
+       * The number of failed finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public boolean hasFailedJobsHistoryLimit() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * + * + *
+       * The number of failed finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public int getFailedJobsHistoryLimit() { + return failedJobsHistoryLimit_; + } + /** + * + * + *
+       * The number of failed finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public Builder setFailedJobsHistoryLimit(int value) { + bitField0_ |= 0x00000040; + failedJobsHistoryLimit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of failed finished jobs to retain.
+       * This is a pointer to distinguish between explicit zero and not specified.
+       * +optional
+       * 
+ * + * optional int32 failedJobsHistoryLimit = 7; + */ + public Builder clearFailedJobsHistoryLimit() { + bitField0_ = (bitField0_ & ~0x00000040); + failedJobsHistoryLimit_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobSpec) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobSpec) + private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CronJobSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CronJobSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CronJobStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + java.util.List getActiveList(); + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + io.kubernetes.client.proto.V1.ObjectReference getActive(int index); + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + int getActiveCount(); + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + java.util.List + getActiveOrBuilderList(); + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index); + + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + boolean hasLastScheduleTime(); + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + io.kubernetes.client.proto.Meta.Time getLastScheduleTime(); + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder(); + } + /** + * + * + *
+   * CronJobStatus represents the current state of a cron job.
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobStatus} + */ + public static final class CronJobStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobStatus) + CronJobStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use CronJobStatus.newBuilder() to construct. + private CronJobStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CronJobStatus() { + active_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CronJobStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + active_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + active_.add( + input.readMessage( + io.kubernetes.client.proto.V1.ObjectReference.PARSER, extensionRegistry)); + break; + } + case 34: + { + io.kubernetes.client.proto.Meta.Time.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = lastScheduleTime_.toBuilder(); + } + lastScheduleTime_ = + input.readMessage( + io.kubernetes.client.proto.Meta.Time.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastScheduleTime_); + lastScheduleTime_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + active_ = java.util.Collections.unmodifiableList(active_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder.class); + } + + private int bitField0_; + public static final int ACTIVE_FIELD_NUMBER = 1; + private java.util.List active_; + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public java.util.List getActiveList() { + return active_; + } + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public java.util.List + getActiveOrBuilderList() { + return active_; + } + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public int getActiveCount() { + return active_.size(); + } + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReference getActive(int index) { + return active_.get(index); + } + /** + * + * + *
+     * A list of pointers to currently running jobs.
+     * +optional
+     * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index) { + return active_.get(index); + } + + public static final int LASTSCHEDULETIME_FIELD_NUMBER = 4; + private io.kubernetes.client.proto.Meta.Time lastScheduleTime_; + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + public boolean hasLastScheduleTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + public io.kubernetes.client.proto.Meta.Time getLastScheduleTime() { + return lastScheduleTime_ == null + ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() + : lastScheduleTime_; + } + /** + * + * + *
+     * Information when was the last time the job was successfully scheduled.
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + */ + public io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder() { + return lastScheduleTime_ == null + ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() + : lastScheduleTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < active_.size(); i++) { + output.writeMessage(1, active_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(4, getLastScheduleTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < active_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, active_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getLastScheduleTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus other = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) obj; + + boolean result = true; + result = result && getActiveList().equals(other.getActiveList()); + result = result && (hasLastScheduleTime() == other.hasLastScheduleTime()); + if (hasLastScheduleTime()) { + result = result && getLastScheduleTime().equals(other.getLastScheduleTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getActiveCount() > 0) { + hash = (37 * hash) + ACTIVE_FIELD_NUMBER; + hash = (53 * hash) + getActiveList().hashCode(); + } + if (hasLastScheduleTime()) { + hash = (37 * hash) + LASTSCHEDULETIME_FIELD_NUMBER; + hash = (53 * hash) + getLastScheduleTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * CronJobStatus represents the current state of a cron job.
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobStatus) + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.class, + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getActiveFieldBuilder(); + getLastScheduleTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (activeBuilder_ == null) { + active_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + activeBuilder_.clear(); + } + if (lastScheduleTimeBuilder_ == null) { + lastScheduleTime_ = null; + } else { + lastScheduleTimeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus build() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus result = + new io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (activeBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + active_ = java.util.Collections.unmodifiableList(active_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.active_ = active_; + } else { + result.active_ = activeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + if (lastScheduleTimeBuilder_ == null) { + result.lastScheduleTime_ = lastScheduleTime_; + } else { + result.lastScheduleTime_ = lastScheduleTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance()) + return this; + if (activeBuilder_ == null) { + if (!other.active_.isEmpty()) { + if (active_.isEmpty()) { + active_ = other.active_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureActiveIsMutable(); + active_.addAll(other.active_); + } + onChanged(); + } + } else { + if (!other.active_.isEmpty()) { + if (activeBuilder_.isEmpty()) { + activeBuilder_.dispose(); + activeBuilder_ = null; + active_ = other.active_; + bitField0_ = (bitField0_ & ~0x00000001); + activeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getActiveFieldBuilder() + : null; + } else { + activeBuilder_.addAllMessages(other.active_); + } + } + } + if (other.hasLastScheduleTime()) { + mergeLastScheduleTime(other.getLastScheduleTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List active_ = + java.util.Collections.emptyList(); + + private void ensureActiveIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + active_ = new java.util.ArrayList(active_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.ObjectReference, + io.kubernetes.client.proto.V1.ObjectReference.Builder, + io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder> + activeBuilder_; + + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public java.util.List getActiveList() { + if (activeBuilder_ == null) { + return java.util.Collections.unmodifiableList(active_); + } else { + return activeBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public int getActiveCount() { + if (activeBuilder_ == null) { + return active_.size(); + } else { + return activeBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReference getActive(int index) { + if (activeBuilder_ == null) { + return active_.get(index); + } else { + return activeBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder setActive(int index, io.kubernetes.client.proto.V1.ObjectReference value) { + if (activeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveIsMutable(); + active_.set(index, value); + onChanged(); + } else { + activeBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder setActive( + int index, io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { + if (activeBuilder_ == null) { + ensureActiveIsMutable(); + active_.set(index, builderForValue.build()); + onChanged(); + } else { + activeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder addActive(io.kubernetes.client.proto.V1.ObjectReference value) { + if (activeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveIsMutable(); + active_.add(value); + onChanged(); + } else { + activeBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder addActive(int index, io.kubernetes.client.proto.V1.ObjectReference value) { + if (activeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveIsMutable(); + active_.add(index, value); + onChanged(); + } else { + activeBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder addActive( + io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { + if (activeBuilder_ == null) { + ensureActiveIsMutable(); + active_.add(builderForValue.build()); + onChanged(); + } else { + activeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder addActive( + int index, io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { + if (activeBuilder_ == null) { + ensureActiveIsMutable(); + active_.add(index, builderForValue.build()); + onChanged(); + } else { + activeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder addAllActive( + java.lang.Iterable values) { + if (activeBuilder_ == null) { + ensureActiveIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, active_); + onChanged(); + } else { + activeBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder clearActive() { + if (activeBuilder_ == null) { + active_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + activeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public Builder removeActive(int index) { + if (activeBuilder_ == null) { + ensureActiveIsMutable(); + active_.remove(index); + onChanged(); + } else { + activeBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReference.Builder getActiveBuilder(int index) { + return getActiveFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index) { + if (activeBuilder_ == null) { + return active_.get(index); + } else { + return activeBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public java.util.List + getActiveOrBuilderList() { + if (activeBuilder_ != null) { + return activeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(active_); + } + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReference.Builder addActiveBuilder() { + return getActiveFieldBuilder() + .addBuilder(io.kubernetes.client.proto.V1.ObjectReference.getDefaultInstance()); + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public io.kubernetes.client.proto.V1.ObjectReference.Builder addActiveBuilder(int index) { + return getActiveFieldBuilder() + .addBuilder(index, io.kubernetes.client.proto.V1.ObjectReference.getDefaultInstance()); + } + /** + * + * + *
+       * A list of pointers to currently running jobs.
+       * +optional
+       * 
+ * + * repeated .k8s.io.api.core.v1.ObjectReference active = 1; + */ + public java.util.List + getActiveBuilderList() { + return getActiveFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.ObjectReference, + io.kubernetes.client.proto.V1.ObjectReference.Builder, + io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder> + getActiveFieldBuilder() { + if (activeBuilder_ == null) { + activeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.kubernetes.client.proto.V1.ObjectReference, + io.kubernetes.client.proto.V1.ObjectReference.Builder, + io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder>( + active_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + active_ = null; + } + return activeBuilder_; + } + + private io.kubernetes.client.proto.Meta.Time lastScheduleTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Time, + io.kubernetes.client.proto.Meta.Time.Builder, + io.kubernetes.client.proto.Meta.TimeOrBuilder> + lastScheduleTimeBuilder_; + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public boolean hasLastScheduleTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public io.kubernetes.client.proto.Meta.Time getLastScheduleTime() { + if (lastScheduleTimeBuilder_ == null) { + return lastScheduleTime_ == null + ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() + : lastScheduleTime_; + } else { + return lastScheduleTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public Builder setLastScheduleTime(io.kubernetes.client.proto.Meta.Time value) { + if (lastScheduleTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastScheduleTime_ = value; + onChanged(); + } else { + lastScheduleTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public Builder setLastScheduleTime( + io.kubernetes.client.proto.Meta.Time.Builder builderForValue) { + if (lastScheduleTimeBuilder_ == null) { + lastScheduleTime_ = builderForValue.build(); + onChanged(); + } else { + lastScheduleTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public Builder mergeLastScheduleTime(io.kubernetes.client.proto.Meta.Time value) { + if (lastScheduleTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && lastScheduleTime_ != null + && lastScheduleTime_ != io.kubernetes.client.proto.Meta.Time.getDefaultInstance()) { + lastScheduleTime_ = + io.kubernetes.client.proto.Meta.Time.newBuilder(lastScheduleTime_) + .mergeFrom(value) + .buildPartial(); + } else { + lastScheduleTime_ = value; + } + onChanged(); + } else { + lastScheduleTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public Builder clearLastScheduleTime() { + if (lastScheduleTimeBuilder_ == null) { + lastScheduleTime_ = null; + onChanged(); + } else { + lastScheduleTimeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public io.kubernetes.client.proto.Meta.Time.Builder getLastScheduleTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLastScheduleTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + public io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder() { + if (lastScheduleTimeBuilder_ != null) { + return lastScheduleTimeBuilder_.getMessageOrBuilder(); + } else { + return lastScheduleTime_ == null + ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() + : lastScheduleTime_; + } + } + /** + * + * + *
+       * Information when was the last time the job was successfully scheduled.
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Time, + io.kubernetes.client.proto.Meta.Time.Builder, + io.kubernetes.client.proto.Meta.TimeOrBuilder> + getLastScheduleTimeFieldBuilder() { + if (lastScheduleTimeBuilder_ == null) { + lastScheduleTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.Time, + io.kubernetes.client.proto.Meta.Time.Builder, + io.kubernetes.client.proto.Meta.TimeOrBuilder>( + getLastScheduleTime(), getParentForChildren(), isClean()); + lastScheduleTime_ = null; + } + return lastScheduleTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobStatus) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobStatus) + private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CronJobStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CronJobStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface JobTemplateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.JobTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + boolean hasTemplate(); + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate(); + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder getTemplateOrBuilder(); + } + /** + * + * + *
+   * JobTemplate describes a template for creating copies of a predefined pod.
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplate} + */ + public static final class JobTemplate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.JobTemplate) + JobTemplateOrBuilder { + private static final long serialVersionUID = 0L; + // Use JobTemplate.newBuilder() to construct. + private JobTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobTemplate() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private JobTemplate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = template_.toBuilder(); + } + template_ = + input.readMessage( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(template_); + template_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.class, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard object's metadata.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int TEMPLATE_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec template_; + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public boolean hasTemplate() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate() { + return template_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : template_; + } + /** + * + * + *
+     * Defines jobs that will be created from this template.
+     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder + getTemplateOrBuilder() { + return template_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : template_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getTemplate()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTemplate()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplate)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate other = + (io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && (hasTemplate() == other.hasTemplate()); + if (hasTemplate()) { + result = result && getTemplate().equals(other.getTemplate()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasTemplate()) { + hash = (37 * hash) + TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getTemplate().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * JobTemplate describes a template for creating copies of a predefined pod.
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplate} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.JobTemplate) + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.class, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getTemplateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (templateBuilder_ == null) { + template_ = null; + } else { + templateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate build() { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate result = + new io.kubernetes.client.proto.V2alpha1Batch.JobTemplate(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (templateBuilder_ == null) { + result.template_ = template_; + } else { + result.template_ = templateBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.JobTemplate other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasTemplate()) { + mergeTemplate(other.getTemplate()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard object's metadata.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec template_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> + templateBuilder_; + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public boolean hasTemplate() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate() { + if (templateBuilder_ == null) { + return template_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : template_; + } else { + return templateBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public Builder setTemplate(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { + if (templateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + template_ = value; + onChanged(); + } else { + templateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public Builder setTemplate( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder builderForValue) { + if (templateBuilder_ == null) { + template_ = builderForValue.build(); + onChanged(); + } else { + templateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public Builder mergeTemplate(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { + if (templateBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && template_ != null + && template_ + != io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec + .getDefaultInstance()) { + template_ = + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder(template_) + .mergeFrom(value) + .buildPartial(); + } else { + template_ = value; + } + onChanged(); + } else { + templateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public Builder clearTemplate() { + if (templateBuilder_ == null) { + template_ = null; + onChanged(); + } else { + templateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder getTemplateBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTemplateFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder + getTemplateOrBuilder() { + if (templateBuilder_ != null) { + return templateBuilder_.getMessageOrBuilder(); + } else { + return template_ == null + ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() + : template_; + } + } + /** + * + * + *
+       * Defines jobs that will be created from this template.
+       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> + getTemplateFieldBuilder() { + if (templateBuilder_ == null) { + templateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder>( + getTemplate(), getParentForChildren(), isClean()); + template_ = null; + } + return templateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.JobTemplate) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.JobTemplate) + private static final io.kubernetes.client.proto.V2alpha1Batch.JobTemplate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.JobTemplate(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobTemplate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JobTemplate(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface JobTemplateSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.JobTemplateSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + boolean hasMetadata(); + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + boolean hasSpec(); + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + io.kubernetes.client.proto.V1Batch.JobSpec getSpec(); + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder(); + } + /** + * + * + *
+   * JobTemplateSpec describes the data a Job should have when created from a template
+   * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplateSpec} + */ + public static final class JobTemplateSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.JobTemplateSpec) + JobTemplateSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use JobTemplateSpec.newBuilder() to construct. + private JobTemplateSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobTemplateSpec() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private JobTemplateSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage( + io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: + { + io.kubernetes.client.proto.V1Batch.JobSpec.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = spec_.toBuilder(); + } + spec_ = + input.readMessage( + io.kubernetes.client.proto.V1Batch.JobSpec.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spec_); + spec_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.class, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+     * Standard object's metadata of the jobs created from this template.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+     * +optional
+     * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + + public static final int SPEC_FIELD_NUMBER = 2; + private io.kubernetes.client.proto.V1Batch.JobSpec spec_; + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public io.kubernetes.client.proto.V1Batch.JobSpec getSpec() { + return spec_ == null + ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() + : spec_; + } + /** + * + * + *
+     * Specification of the desired behavior of the job.
+     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+     * +optional
+     * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder() { + return spec_ == null + ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() + : spec_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getSpec()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec)) { + return super.equals(obj); + } + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec other = + (io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) obj; + + boolean result = true; + result = result && (hasMetadata() == other.hasMetadata()); + if (hasMetadata()) { + result = result && getMetadata().equals(other.getMetadata()); + } + result = result && (hasSpec() == other.hasSpec()); + if (hasSpec()) { + result = result && getSpec().equals(other.getSpec()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * JobTemplateSpec describes the data a Job should have when created from a template
+     * 
+ * + * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplateSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.JobTemplateSpec) + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.class, + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder.class); + } + + // Construct using io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetadataFieldBuilder(); + getSpecFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (specBuilder_ == null) { + spec_ = null; + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.kubernetes.client.proto.V2alpha1Batch + .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstanceForType() { + return io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance(); + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec build() { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec buildPartial() { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec result = + new io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (specBuilder_ == null) { + result.spec_ = spec_; + } else { + result.spec_ = specBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) { + return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec other) { + if (other == io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder setMetadata( + io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && metadata_ != null + && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { + metadata_ = + io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+       * Standard object's metadata of the jobs created from this template.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+       * +optional
+       * 
+ * + * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.Meta.ObjectMeta, + io.kubernetes.client.proto.Meta.ObjectMeta.Builder, + io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private io.kubernetes.client.proto.V1Batch.JobSpec spec_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Batch.JobSpec, + io.kubernetes.client.proto.V1Batch.JobSpec.Builder, + io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder> + specBuilder_; + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public io.kubernetes.client.proto.V1Batch.JobSpec getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public Builder setSpec(io.kubernetes.client.proto.V1Batch.JobSpec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + onChanged(); + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public Builder setSpec(io.kubernetes.client.proto.V1Batch.JobSpec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + onChanged(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public Builder mergeSpec(io.kubernetes.client.proto.V1Batch.JobSpec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) + && spec_ != null + && spec_ != io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance()) { + spec_ = + io.kubernetes.client.proto.V1Batch.JobSpec.newBuilder(spec_) + .mergeFrom(value) + .buildPartial(); + } else { + spec_ = value; + } + onChanged(); + } else { + specBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public Builder clearSpec() { + if (specBuilder_ == null) { + spec_ = null; + onChanged(); + } else { + specBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public io.kubernetes.client.proto.V1Batch.JobSpec.Builder getSpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + public io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+       * Specification of the desired behavior of the job.
+       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+       * +optional
+       * 
+ * + * optional .k8s.io.api.batch.v1.JobSpec spec = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Batch.JobSpec, + io.kubernetes.client.proto.V1Batch.JobSpec.Builder, + io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.kubernetes.client.proto.V1Batch.JobSpec, + io.kubernetes.client.proto.V1Batch.JobSpec.Builder, + io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.JobTemplateSpec) + } + + // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.JobTemplateSpec) + private static final io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec(); + } + + public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated + public static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobTemplateSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JobTemplateSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)k8s.io/api/batch/v2alpha1/generated.pr" + + "oto\022\031k8s.io.api.batch.v2alpha1\032#k8s.io/a" + + "pi/batch/v1/generated.proto\032\"k8s.io/api/" + + "core/v1/generated.proto\0324k8s.io/apimachi" + + "nery/pkg/apis/meta/v1/generated.proto\032/k" + + "8s.io/apimachinery/pkg/runtime/generated" + + ".proto\0326k8s.io/apimachinery/pkg/runtime/" + + "schema/generated.proto\"\275\001\n\007CronJob\022B\n\010me" + + "tadata\030\001 \001(\01320.k8s.io.apimachinery.pkg.a" + + "pis.meta.v1.ObjectMeta\0224\n\004spec\030\002 \001(\0132&.k" + + "8s.io.api.batch.v2alpha1.CronJobSpec\0228\n\006" + + "status\030\003 \001(\0132(.k8s.io.api.batch.v2alpha1" + + ".CronJobStatus\"\202\001\n\013CronJobList\022@\n\010metada" + + "ta\030\001 \001(\0132..k8s.io.apimachinery.pkg.apis." + + "meta.v1.ListMeta\0221\n\005items\030\002 \003(\0132\".k8s.io" + + ".api.batch.v2alpha1.CronJob\"\361\001\n\013CronJobS" + + "pec\022\020\n\010schedule\030\001 \001(\t\022\037\n\027startingDeadlin" + + "eSeconds\030\002 \001(\003\022\031\n\021concurrencyPolicy\030\003 \001(" + + "\t\022\017\n\007suspend\030\004 \001(\010\022?\n\013jobTemplate\030\005 \001(\0132" + + "*.k8s.io.api.batch.v2alpha1.JobTemplateS" + + "pec\022\"\n\032successfulJobsHistoryLimit\030\006 \001(\005\022" + + "\036\n\026failedJobsHistoryLimit\030\007 \001(\005\"\212\001\n\rCron" + + "JobStatus\0223\n\006active\030\001 \003(\0132#.k8s.io.api.c" + + "ore.v1.ObjectReference\022D\n\020lastScheduleTi" + + "me\030\004 \001(\0132*.k8s.io.apimachinery.pkg.apis." + + "meta.v1.Time\"\217\001\n\013JobTemplate\022B\n\010metadata" + + "\030\001 \001(\01320.k8s.io.apimachinery.pkg.apis.me" + + "ta.v1.ObjectMeta\022<\n\010template\030\002 \001(\0132*.k8s" + + ".io.api.batch.v2alpha1.JobTemplateSpec\"\201" + + "\001\n\017JobTemplateSpec\022B\n\010metadata\030\001 \001(\01320.k" + + "8s.io.apimachinery.pkg.apis.meta.v1.Obje" + + "ctMeta\022*\n\004spec\030\002 \001(\0132\034.k8s.io.api.batch." + + "v1.JobSpecB5\n\032io.kubernetes.client.proto" + + "B\rV2alpha1BatchZ\010v2alpha1" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.kubernetes.client.proto.V1Batch.getDescriptor(), + io.kubernetes.client.proto.V1.getDescriptor(), + io.kubernetes.client.proto.Meta.getDescriptor(), + io.kubernetes.client.proto.Runtime.getDescriptor(), + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), + }, + assigner); + internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor, + new java.lang.String[] { + "Metadata", "Spec", "Status", + }); + internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor, + new java.lang.String[] { + "Metadata", "Items", + }); + internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor, + new java.lang.String[] { + "Schedule", + "StartingDeadlineSeconds", + "ConcurrencyPolicy", + "Suspend", + "JobTemplate", + "SuccessfulJobsHistoryLimit", + "FailedJobsHistoryLimit", + }); + internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor, + new java.lang.String[] { + "Active", "LastScheduleTime", + }); + internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor, + new java.lang.String[] { + "Metadata", "Template", + }); + internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor, + new java.lang.String[] { + "Metadata", "Spec", + }); + io.kubernetes.client.proto.V1Batch.getDescriptor(); + io.kubernetes.client.proto.V1.getDescriptor(); + io.kubernetes.client.proto.Meta.getDescriptor(); + io.kubernetes.client.proto.Runtime.getDescriptor(); + io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java b/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java new file mode 100644 index 0000000000..bfedca2687 --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java @@ -0,0 +1,84 @@ +/* +Copyright 2020 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.util.authenticators; + +import com.microsoft.aad.adal4j.AuthenticationContext; +import com.microsoft.aad.adal4j.AuthenticationResult; +import io.kubernetes.client.util.KubeConfig; +import java.net.MalformedURLException; +import java.util.Date; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * The Authenticator interface represents a plugin that can handle a specific type of authentication + * information (e.g. 'azure') + */ +public class AzureActiveDirectoryAuthenticator implements Authenticator { + static { + KubeConfig.registerAuthenticator(new AzureActiveDirectoryAuthenticator()); + } + + private static final String ACCESS_TOKEN = "access-token"; + private static final String EXPIRES_ON = "expires-on"; + private static final String TENANT_ID = "tenant-id"; + private static final String CLIENT_ID = "client-id"; + private static final String REFRESH_TOKEN = "refresh-token"; + + @Override + public String getName() { + return "azure"; + } + + @Override + public String getToken(Map config) { + return (String) config.get(ACCESS_TOKEN); + } + + @Override + public boolean isExpired(Map config) { + String expiresOn = (String) config.get(EXPIRES_ON); + if (expiresOn == null || expiresOn.length() == 0) { + return true; + } + Date expiry = new Date(Long.parseLong(expiresOn) * 1000); + return expiry.compareTo(new Date()) <= 0; + } + + @Override + public Map refresh(Map config) { + // TODO: Support national clouds! + String cloud = "https://login.microsoftonline.com"; + String tenantId = (String) config.get(TENANT_ID); + String authority = cloud + "/" + tenantId; + String clientId = (String) config.get(CLIENT_ID); + String refreshToken = (String) config.get(REFRESH_TOKEN); + + try { + AuthenticationContext context = + new AuthenticationContext(authority, true, Executors.newSingleThreadExecutor()); + Future resultFuture = + context.acquireTokenByRefreshToken(refreshToken, clientId, null); + AuthenticationResult result = resultFuture.get(); + config.put(ACCESS_TOKEN, result.getAccessToken()); + config.put(REFRESH_TOKEN, result.getRefreshToken()); + + return config; + + } catch (InterruptedException | MalformedURLException | ExecutionException ex) { + throw new RuntimeException(ex); + } + } +} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java b/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java new file mode 100644 index 0000000000..884422de18 --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java @@ -0,0 +1,141 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.util.eks; + +import org.apache.http.client.utils.URIBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Date; +import java.util.Map; + + +/** + * Sample AWS4 signer demonstrating how to sign requests to Amazon S3 using + * query string parameters. + */ +public class AWS4STSSigner extends AWS4SignerBase { + + private static final Logger log = LoggerFactory.getLogger(AWS4STSSigner.class); + + public AWS4STSSigner(URL endpointUrl, String httpMethod, + String serviceName, String regionName) { + super(endpointUrl, httpMethod, serviceName, regionName); + } + + /** + * Computes an AWS4 authorization for a request, suitable for embedding in + * query parameters. + * + * @param headers + * The request headers; 'Host' and 'X-Amz-Date' will be added to + * this set. + * @param queryParameters + * Any query parameters that will be added to the endpoint. The + * parameters should be specified in canonical format. + * @param bodyHash + * Precomputed SHA256 hash of the request body content; this + * value should also be set as the header 'X-Amz-Content-SHA256' + * for non-streaming uploads. + * @param awsAccessKey + * The user's AWS Access Key. + * @param awsSecretKey + * The user's AWS Secret Key. + * @return The computed authorization string for the request. This value + * needs to be set as the header 'Authorization' on the subsequent + * HTTP request. + */ + public String computeSignature(URI endpoint, + Map headers, + Map queryParameters, + int expiringInSeconds, + String bodyHash, + String awsAccessKey, + String awsSecretKey, + String sessionToken) throws URISyntaxException { + // first get the date and time for the subsequent request, and convert + // to ISO 8601 format + // for use in signature generation + Date now = new Date(); + String dateTimeStamp = dateTimeFormat.format(now); + + // make sure "Host" header is added + String hostHeader = endpointUrl.getHost(); + int port = endpointUrl.getPort(); + if ( port > -1 ) { + hostHeader.concat(":" + Integer.toString(port)); + } + headers.put("Host", hostHeader); + + // canonicalized headers need to be expressed in the query + // parameters processed in the signature + String canonicalizedHeaderNames = getCanonicalizeHeaderNames(headers); + String canonicalizedHeaders = getCanonicalizedHeaderString(headers); + + // we need scope as part of the query parameters + String dateStamp = dateStampFormat.format(now); + String scope = dateStamp + "/" + regionName + "/" + serviceName + "/" + TERMINATOR; + + // add the fixed authorization params required by Signature V4 + queryParameters.put("X-Amz-Algorithm", SCHEME + "-" + ALGORITHM); + queryParameters.put("X-Amz-Credential", awsAccessKey + "/" + scope); + + // x-amz-date is now added as a query parameter, but still need to be in ISO8601 basic form + queryParameters.put("X-Amz-Date", dateTimeStamp); + queryParameters.put("X-Amz-Expires", String.valueOf(expiringInSeconds)); + + queryParameters.put("X-Amz-Security-Token", sessionToken); + + queryParameters.put("X-Amz-SignedHeaders", canonicalizedHeaderNames); + + // build the expanded canonical query parameter string that will go into the + // signature computation + String canonicalizedQueryParameters = getCanonicalizedQueryString(queryParameters); + + // express all the header and query parameter data as a canonical request string + String canonicalRequest = getCanonicalRequest(endpointUrl, httpMethod, + canonicalizedQueryParameters, canonicalizedHeaderNames, + canonicalizedHeaders, bodyHash); + log.debug("--------- Canonical request --------"); + log.debug(canonicalRequest); + log.debug("------------------------------------"); + + // construct the string to be signed + String stringToSign = getStringToSign(SCHEME, ALGORITHM, dateTimeStamp, scope, canonicalRequest); + log.debug("--------- String to sign -----------"); + log.debug(stringToSign); + log.debug("------------------------------------"); + + // compute the signing key + byte[] kSecret = (SCHEME + awsSecretKey).getBytes(); + byte[] kDate = sign(dateStamp, kSecret, "HmacSHA256"); + byte[] kRegion = sign(regionName, kDate, "HmacSHA256"); + byte[] kService = sign(serviceName, kRegion, "HmacSHA256"); + byte[] kSigning = sign(TERMINATOR, kService, "HmacSHA256"); + byte[] signature = sign(stringToSign, kSigning, "HmacSHA256"); + + // form up the authorization parameters for the caller to place in the query string + StringBuilder authString = new StringBuilder(); + URIBuilder builder = new URIBuilder(endpoint); + queryParameters.forEach((k, v)-> { + builder.addParameter(k, v); + }); + builder.addParameter("X-Amz-Signature", BinaryUtils.toHex(signature)); + authString.append(builder.build()); + return authString.toString(); + } + +} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java b/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java new file mode 100644 index 0000000000..131a24c63f --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java @@ -0,0 +1,256 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.util.eks; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.net.URL; +import java.security.MessageDigest; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.SimpleTimeZone; +import java.util.SortedMap; +import java.util.TreeMap; + + +/** + * Common methods and properties for all AWS4 signer variants + */ +public abstract class AWS4SignerBase { + + /** SHA256 hash of an empty request body **/ + public static final String EMPTY_BODY_SHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + public static final String UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; + + public static final String SCHEME = "AWS4"; + public static final String ALGORITHM = "HMAC-SHA256"; + public static final String TERMINATOR = "aws4_request"; + + /** format strings for the date/time and date stamps required during signing **/ + public static final String ISO8601BasicFormat = "yyyyMMdd'T'HHmmss'Z'"; + public static final String DateStringFormat = "yyyyMMdd"; + + protected URL endpointUrl; + protected String httpMethod; + protected String serviceName; + protected String regionName; + + protected final SimpleDateFormat dateTimeFormat; + protected final SimpleDateFormat dateStampFormat; + + /** + * Create a new AWS V4 signer. + * + * @param endpointUrl + * The service endpoint, including the path to any resource. + * @param httpMethod + * The HTTP verb for the request, e.g. GET. + * @param serviceName + * The signing name of the service, e.g. 's3'. + * @param regionName + * The system name of the AWS region associated with the + * endpoint, e.g. us-east-1. + */ + public AWS4SignerBase(URL endpointUrl, String httpMethod, + String serviceName, String regionName) { + this.endpointUrl = endpointUrl; + this.httpMethod = httpMethod; + this.serviceName = serviceName; + this.regionName = regionName; + + dateTimeFormat = new SimpleDateFormat(ISO8601BasicFormat); + dateTimeFormat.setTimeZone(new SimpleTimeZone(0, "UTC")); + dateStampFormat = new SimpleDateFormat(DateStringFormat); + dateStampFormat.setTimeZone(new SimpleTimeZone(0, "UTC")); + } + + /** + * Returns the canonical collection of header names that will be included in + * the signature. For AWS4, all header names must be included in the process + * in sorted canonicalized order. + */ + protected static String getCanonicalizeHeaderNames(Map headers) { + List sortedHeaders = new ArrayList(); + sortedHeaders.addAll(headers.keySet()); + Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); + + StringBuilder buffer = new StringBuilder(); + for (String header : sortedHeaders) { + if (buffer.length() > 0) buffer.append(";"); + buffer.append(header.toLowerCase()); + } + + return buffer.toString(); + } + + /** + * Computes the canonical headers with values for the request. For AWS4, all + * headers must be included in the signing process. + */ + protected static String getCanonicalizedHeaderString(Map headers) { + if ( headers == null || headers.isEmpty() ) { + return ""; + } + + // step1: sort the headers by case-insensitive order + List sortedHeaders = new ArrayList(); + sortedHeaders.addAll(headers.keySet()); + Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); + + // step2: form the canonical header:value entries in sorted order. + // Multiple white spaces in the values should be compressed to a single + // space. + StringBuilder buffer = new StringBuilder(); + for (String key : sortedHeaders) { + buffer.append(key.toLowerCase().replaceAll("\\s+", " ") + ":" + headers.get(key).replaceAll("\\s+", " ")); + buffer.append("\n"); + } + + return buffer.toString(); + } + + /** + * Returns the canonical request string to go into the signer process; this + consists of several canonical sub-parts. + * @return + */ + protected static String getCanonicalRequest(URL endpoint, + String httpMethod, + String queryParameters, + String canonicalizedHeaderNames, + String canonicalizedHeaders, + String bodyHash) { + String canonicalRequest = + httpMethod + "\n" + + getCanonicalizedResourcePath(endpoint) + "\n" + + queryParameters + "\n" + + canonicalizedHeaders + "\n" + + canonicalizedHeaderNames + "\n" + + bodyHash; + return canonicalRequest; + } + + /** + * Returns the canonicalized resource path for the service endpoint. + */ + protected static String getCanonicalizedResourcePath(URL endpoint) { + if ( endpoint == null ) { + return "/"; + } + String path = endpoint.getPath(); + if ( path == null || path.isEmpty() ) { + return "/"; + } + + String encodedPath = HttpUtils.urlEncode(path, true); + if (encodedPath.startsWith("/")) { + return encodedPath; + } else { + return "/".concat(encodedPath); + } + } + + /** + * Examines the specified query string parameters and returns a + * canonicalized form. + *

+ * The canonicalized query string is formed by first sorting all the query + * string parameters, then URI encoding both the key and value and then + * joining them, in order, separating key value pairs with an '&'. + * + * @param parameters + * The query string parameters to be canonicalized. + * + * @return A canonicalized form for the specified query string parameters. + */ + public static String getCanonicalizedQueryString(Map parameters) { + if ( parameters == null || parameters.isEmpty() ) { + return ""; + } + + SortedMap sorted = new TreeMap(); + + Iterator> pairs = parameters.entrySet().iterator(); + while (pairs.hasNext()) { + Map.Entry pair = pairs.next(); + String key = pair.getKey(); + String value = pair.getValue(); + sorted.put(HttpUtils.urlEncode(key, false), HttpUtils.urlEncode(value, false)); + } + + StringBuilder builder = new StringBuilder(); + pairs = sorted.entrySet().iterator(); + while (pairs.hasNext()) { + Map.Entry pair = pairs.next(); + builder.append(pair.getKey()); + builder.append("="); + builder.append(pair.getValue()); + if (pairs.hasNext()) { + builder.append("&"); + } + } + + return builder.toString(); + } + + protected static String getStringToSign(String scheme, String algorithm, String dateTime, String scope, String canonicalRequest) { + String stringToSign = + scheme + "-" + algorithm + "\n" + + dateTime + "\n" + + scope + "\n" + + BinaryUtils.toHex(hash(canonicalRequest)); + return stringToSign; + } + + /** + * Hashes the string contents (assumed to be UTF-8) using the SHA-256 + * algorithm. + */ + public static byte[] hash(String text) { + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + md.update(text.getBytes("UTF-8")); + return md.digest(); + } catch (Exception e) { + throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(), e); + } + } + + /** + * Hashes the byte array using the SHA-256 algorithm. + */ + public static byte[] hash(byte[] data) { + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + md.update(data); + return md.digest(); + } catch (Exception e) { + throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(), e); + } + } + + protected static byte[] sign(String stringData, byte[] key, String algorithm) { + try { + byte[] data = stringData.getBytes("UTF-8"); + Mac mac = Mac.getInstance(algorithm); + mac.init(new SecretKeySpec(key, algorithm)); + return mac.doFinal(data); + } catch (Exception e) { + throw new RuntimeException("Unable to calculate a request signature: " + e.getMessage(), e); + } + } +} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java b/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java new file mode 100644 index 0000000000..039ef20ad8 --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java @@ -0,0 +1,65 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.util.eks; + +import java.util.Locale; + +/** + * Utilities for encoding and decoding binary data to and from different forms. + */ +public class BinaryUtils { + + /** + * Converts byte data to a Hex-encoded string. + * + * @param data + * data to hex encode. + * + * @return hex-encoded string. + */ + public static String toHex(byte[] data) { + StringBuilder sb = new StringBuilder(data.length * 2); + for (int i = 0; i < data.length; i++) { + String hex = Integer.toHexString(data[i]); + if (hex.length() == 1) { + // Append leading zero. + sb.append("0"); + } else if (hex.length() == 8) { + // Remove ff prefix from negative numbers. + hex = hex.substring(6); + } + sb.append(hex); + } + return sb.toString().toLowerCase(Locale.getDefault()); + } + + /** + * Converts a Hex-encoded data string to the original byte data. + * + * @param hexData + * hex-encoded data to decode. + * @return decoded data from the hex string. + */ + public static byte[] fromHex(String hexData) { + byte[] result = new byte[(hexData.length() + 1) / 2]; + String hexNumber = null; + int stringOffset = 0; + int byteOffset = 0; + while (stringOffset < hexData.length()) { + hexNumber = hexData.substring(stringOffset, stringOffset + 2); + stringOffset += 2; + result[byteOffset++] = (byte) Integer.parseInt(hexNumber, 16); + } + return result; + } +} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java b/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java new file mode 100644 index 0000000000..470564b9f0 --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java @@ -0,0 +1,121 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package io.kubernetes.client.util.eks; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Map; + +/** + * Various Http helper routines + */ +public class HttpUtils { + + private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + /** + * Makes a http request to the specified endpoint + */ + public static String invokeHttpRequest(URL endpointUrl, + String httpMethod, + Map headers, + String requestBody) { + HttpURLConnection connection = createHttpConnection(endpointUrl, httpMethod, headers); + try { + if ( requestBody != null ) { + DataOutputStream wr = new DataOutputStream( + connection.getOutputStream()); + wr.writeBytes(requestBody); + wr.flush(); + wr.close(); + } + } catch (Exception e) { + throw new RuntimeException("Request failed. " + e.getMessage(), e); + } + return executeHttpRequest(connection); + } + + public static String executeHttpRequest(HttpURLConnection connection) { + try { + // Get Response + InputStream is; + try { + is = connection.getInputStream(); + } catch (IOException e) { + is = connection.getErrorStream(); + } + + BufferedReader rd = new BufferedReader(new InputStreamReader(is)); + String line; + StringBuffer response = new StringBuffer(); + while ((line = rd.readLine()) != null) { + response.append(line); + response.append('\r'); + } + rd.close(); + return response.toString(); + } catch (Exception e) { + throw new RuntimeException("Request failed. " + e.getMessage(), e); + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } + + public static HttpURLConnection createHttpConnection(URL endpointUrl, + String httpMethod, + Map headers) { + try { + HttpURLConnection connection = (HttpURLConnection) endpointUrl.openConnection(); + connection.setRequestMethod(httpMethod); + + if ( headers != null ) { + log.debug("--------- Request headers ---------"); + for ( String headerKey : headers.keySet() ) { + log.debug(headerKey + ": " + headers.get(headerKey)); + connection.setRequestProperty(headerKey, headers.get(headerKey)); + } + } + + connection.setUseCaches(false); + connection.setDoInput(true); + connection.setDoOutput(true); + return connection; + } catch (Exception e) { + throw new RuntimeException("Cannot create connection. " + e.getMessage(), e); + } + } + + public static String urlEncode(String url, boolean keepPathSlash) { + String encoded; + try { + encoded = URLEncoder.encode(url, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 encoding is not supported.", e); + } + if ( keepPathSlash ) { + encoded = encoded.replace("%2F", "/"); + } + return encoded; + } +} From dae044918a4b4c91e3106e3f44d2e6fc60afa2d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 20:41:24 +0000 Subject: [PATCH 3/3] revert: remove accidentally added master-java8-only files Agent-Logs-Url: https://github.com/kubernetes-client/java/sessions/08f7f810-1768-4b14-80b6-d65e39588846 Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com> --- .devcontainer/Dockerfile | 67 - .devcontainer/library-scripts/README.md | 5 - .../library-scripts/common-debian.sh | 123 - .devcontainer/library-scripts/node-debian.sh | 50 - .devcontainer/maven-settings.xml | 6 - .mvn/wrapper/MavenWrapperDownloader.java | 117 - client-java-contrib/Dockerfile.gen | 13 - client-java-contrib/Dockerfile.gen-base | 43 - .../manager/models/V1alpha2Certificate.java | 216 - .../models/V1alpha2CertificateList.java | 192 - .../models/V1alpha2CertificateRequest.java | 218 - .../V1alpha2CertificateRequestList.java | 194 - .../V1alpha2CertificateRequestSpec.java | 328 - .../models/V1alpha2CertificateSpec.java | 886 - .../V1alpha2CertificateSpecPrivateKey.java | 95 - .../V1alpha2CertificateSpecSubject.java | 317 - .../manager/models/V1alpha2Challenge.java | 209 - .../manager/models/V1alpha2ChallengeList.java | 192 - .../manager/models/V1alpha2ClusterIssuer.java | 217 - .../models/V1alpha2ClusterIssuerList.java | 192 - .../cert/manager/models/V1alpha2Issuer.java | 216 - .../manager/models/V1alpha2IssuerList.java | 192 - .../manager/models/V1alpha2IssuerSpec.java | 199 - .../models/V1alpha2IssuerSpecAcme.java | 271 - .../models/V1alpha2IssuerSpecAcmeDns01.java | 412 - .../V1alpha2IssuerSpecAcmeDns01Acmedns.java | 122 - ...rSpecAcmeDns01AcmednsAccountSecretRef.java | 128 - .../V1alpha2IssuerSpecAcmeDns01Akamai.java | 187 - .../V1alpha2IssuerSpecAcmeDns01Azuredns.java | 323 - ...cmeDns01AzurednsClientSecretSecretRef.java | 123 - .../V1alpha2IssuerSpecAcmeDns01Clouddns.java | 153 - ...V1alpha2IssuerSpecAcmeDns01Cloudflare.java | 151 - ...pecAcmeDns01CloudflareApiKeySecretRef.java | 128 - ...cAcmeDns01CloudflareApiTokenSecretRef.java | 123 - ...alpha2IssuerSpecAcmeDns01Digitalocean.java | 89 - .../V1alpha2IssuerSpecAcmeDns01Rfc2136.java | 195 - ...ecAcmeDns01Rfc2136TsigSecretSecretRef.java | 128 - .../V1alpha2IssuerSpecAcmeDns01Route53.java | 219 - ...eDns01Route53SecretAccessKeySecretRef.java | 130 - .../V1alpha2IssuerSpecAcmeDns01Webhook.java | 159 - ...2IssuerSpecAcmeExternalAccountBinding.java | 213 - ...cmeExternalAccountBindingKeySecretRef.java | 131 - .../models/V1alpha2IssuerSpecAcmeHttp01.java | 93 - .../V1alpha2IssuerSpecAcmeHttp01Ingress.java | 218 - ...rSpecAcmeHttp01IngressIngressTemplate.java | 96 - ...eHttp01IngressIngressTemplateMetadata.java | 150 - ...ssuerSpecAcmeHttp01IngressPodTemplate.java | 122 - ...cAcmeHttp01IngressPodTemplateMetadata.java | 147 - ...rSpecAcmeHttp01IngressPodTemplateSpec.java | 185 - ...eHttp01IngressPodTemplateSpecAffinity.java | 158 - ...ssPodTemplateSpecAffinityNodeAffinity.java | 179 - ...ateSpecAffinityNodeAffinityPreference.java | 174 - ...odeAffinityPreferenceMatchExpressions.java | 187 - ...uringSchedulingIgnoredDuringExecution.java | 141 - ...uringSchedulingIgnoredDuringExecution.java | 128 - ...noredDuringExecutionNodeSelectorTerms.java | 185 - ...essPodTemplateSpecAffinityPodAffinity.java | 207 - ...pecAffinityPodAffinityPodAffinityTerm.java | 186 - ...dAffinityPodAffinityTermLabelSelector.java | 175 - ...nityTermLabelSelectorMatchExpressions.java | 186 - ...uringSchedulingIgnoredDuringExecution.java | 142 - ...uringSchedulingIgnoredDuringExecution.java | 198 - ...odTemplateSpecAffinityPodAntiAffinity.java | 208 - ...tp01IngressPodTemplateSpecTolerations.java | 231 - ...pha2IssuerSpecAcmePrivateKeySecretRef.java | 129 - .../V1alpha2IssuerSpecAcmeSelector.java | 194 - .../models/V1alpha2IssuerSpecAcmeSolvers.java | 148 - .../manager/models/V1alpha2IssuerSpecCa.java | 138 - .../models/V1alpha2IssuerSpecSelfSigned.java | 110 - .../models/V1alpha2IssuerSpecVault.java | 183 - .../models/V1alpha2IssuerSpecVaultAuth.java | 144 - .../V1alpha2IssuerSpecVaultAuthAppRole.java | 154 - ...a2IssuerSpecVaultAuthAppRoleSecretRef.java | 128 - ...V1alpha2IssuerSpecVaultAuthKubernetes.java | 157 - ...ssuerSpecVaultAuthKubernetesSecretRef.java | 127 - ...pha2IssuerSpecVaultAuthTokenSecretRef.java | 122 - .../models/V1alpha2IssuerSpecVenafi.java | 151 - .../models/V1alpha2IssuerSpecVenafiCloud.java | 122 - ...ssuerSpecVenafiCloudApiTokenSecretRef.java | 123 - .../models/V1alpha2IssuerSpecVenafiTpp.java | 157 - ...pha2IssuerSpecVenafiTppCredentialsRef.java | 96 - .../manager/models/V1alpha2IssuerStatus.java | 128 - .../models/V1alpha2IssuerStatusAcme.java | 128 - .../V1alpha2IssuerStatusConditions.java | 261 - .../io/cert/manager/models/V1alpha2Order.java | 209 - .../manager/models/V1alpha2OrderList.java | 192 - .../manager/models/V1alpha3Certificate.java | 216 - .../models/V1alpha3CertificateList.java | 192 - .../models/V1alpha3CertificateRequest.java | 218 - .../V1alpha3CertificateRequestList.java | 194 - .../models/V1alpha3CertificateSpec.java | 848 - .../manager/models/V1alpha3Challenge.java | 209 - .../manager/models/V1alpha3ChallengeList.java | 192 - .../manager/models/V1alpha3ChallengeSpec.java | 385 - .../V1alpha3ChallengeSpecIssuerRef.java | 149 - .../models/V1alpha3ChallengeSpecSolver.java | 148 - .../models/V1alpha3ChallengeStatus.java | 248 - .../manager/models/V1alpha3ClusterIssuer.java | 217 - .../models/V1alpha3ClusterIssuerList.java | 192 - .../models/V1alpha3ClusterIssuerSpec.java | 199 - .../models/V1alpha3ClusterIssuerStatus.java | 129 - .../cert/manager/models/V1alpha3Issuer.java | 216 - .../manager/models/V1alpha3IssuerList.java | 192 - .../io/cert/manager/models/V1alpha3Order.java | 209 - .../manager/models/V1alpha3OrderList.java | 192 - .../manager/models/V1alpha3OrderSpec.java | 186 - .../manager/models/V1beta1Certificate.java | 215 - .../models/V1beta1CertificateList.java | 192 - .../models/V1beta1CertificateRequest.java | 217 - .../models/V1beta1CertificateRequestList.java | 193 - .../models/V1beta1CertificateRequestSpec.java | 326 - ...1beta1CertificateRequestSpecIssuerRef.java | 152 - .../V1beta1CertificateRequestStatus.java | 200 - ...ta1CertificateRequestStatusConditions.java | 266 - .../models/V1beta1CertificateSpec.java | 640 - .../V1beta1CertificateSpecIssuerRef.java | 151 - .../V1beta1CertificateSpecKeystores.java | 121 - .../V1beta1CertificateSpecKeystoresJks.java | 128 - ...cateSpecKeystoresJksPasswordSecretRef.java | 128 - ...V1beta1CertificateSpecKeystoresPkcs12.java | 128 - ...eSpecKeystoresPkcs12PasswordSecretRef.java | 128 - .../V1beta1CertificateSpecPrivateKey.java | 303 - .../models/V1beta1CertificateSpecSubject.java | 353 - .../models/V1beta1CertificateStatus.java | 308 - .../V1beta1CertificateStatusConditions.java | 263 - .../cert/manager/models/V1beta1Challenge.java | 208 - .../manager/models/V1beta1ChallengeList.java | 192 - .../manager/models/V1beta1ChallengeSpec.java | 385 - .../models/V1beta1ChallengeSpecIssuerRef.java | 148 - .../models/V1beta1ChallengeSpecSolver.java | 147 - .../V1beta1ChallengeSpecSolverDns01.java | 414 - .../models/V1beta1ChallengeStatus.java | 247 - .../manager/models/V1beta1ClusterIssuer.java | 216 - .../models/V1beta1ClusterIssuerList.java | 192 - .../models/V1beta1ClusterIssuerSpec.java | 199 - .../io/cert/manager/models/V1beta1Issuer.java | 215 - .../manager/models/V1beta1IssuerList.java | 192 - .../manager/models/V1beta1IssuerSpec.java | 199 - .../manager/models/V1beta1IssuerSpecAcme.java | 270 - .../models/V1beta1IssuerSpecAcmeSolvers.java | 148 - .../io/cert/manager/models/V1beta1Order.java | 208 - .../cert/manager/models/V1beta1OrderList.java | 192 - .../cert/manager/models/V1beta1OrderSpec.java | 186 - .../models/V1beta1OrderSpecIssuerRef.java | 148 - .../manager/models/V1beta1OrderStatus.java | 353 - .../V1beta1OrderStatusAuthorizations.java | 303 - .../models/V1beta1OrderStatusChallenges.java | 159 - .../client/e2e/basic/CoreV1ApiTest.groovy | 39 - .../kubernetes/client/e2e/csr/CSRTest.groovy | 66 - .../client/e2e/dynamic/DynamicApiTest.groovy | 38 - .../e2e/informer/NamespaceInformerTest.groovy | 51 - .../e2e/kubectl/KubectlDrainTest.groovy | 61 - .../e2e/kubectl/KubectlNamespaceTest.groovy | 85 - .../e2e/kubectl/KubectlRolloutTest.groovy | 216 - .../client/e2e/util/ModelMapperTest.groovy | 46 - examples/examples-release-16/Dockerfile | 7 - examples/examples-release-16/README.md | 13 - examples/examples-release-16/createPod.sh | 26 - examples/examples-release-16/pom.xml | 118 - .../client/examples/AttachExample.java | 77 - .../client/examples/CertManagerExample.java | 45 - .../client/examples/ControllerExample.java | 163 - .../client/examples/CopyExample.java | 51 - .../client/examples/DynamicClientExample.java | 42 - .../kubernetes/client/examples/Example.java | 44 - .../client/examples/ExecExample.java | 96 - .../client/examples/ExpandedExample.java | 274 - .../client/examples/FluentExample.java | 75 - .../client/examples/GenericClientExample.java | 63 - .../examples/InClusterClientExample.java | 58 - .../client/examples/InformerExample.java | 106 - .../examples/KubeConfigFileClientExample.java | 58 - .../client/examples/KubectlExample.java | 311 - .../examples/LeaderElectionExample.java | 56 - .../client/examples/LogsExample.java | 51 - .../client/examples/MetricsExample.java | 68 - .../client/examples/PagerExample.java | 72 - .../client/examples/ParseExample.java | 64 - .../client/examples/PatchExample.java | 129 - .../client/examples/PortForwardExample.java | 87 - .../client/examples/PromOpExample.java | 43 - .../client/examples/PrometheusExample.java | 66 - .../client/examples/ProtoExample.java | 69 - .../examples/SpringControllerExample.java | 147 - .../examples/SpringLoadBalancerExample.java | 68 - .../client/examples/WatchExample.java | 54 - .../client/examples/WebSocketsExample.java | 74 - .../client/examples/YamlExample.java | 109 - .../src/main/resources/application.properties | 2 - .../client/examples/ExampleTest.java | 55 - examples/examples-release-16/test-svc.yaml | 11 - examples/examples-release-16/test.yaml | 16 - examples/examples-release-17/Dockerfile | 7 - examples/examples-release-17/README.md | 13 - examples/examples-release-17/createPod.sh | 26 - examples/examples-release-17/pom.xml | 118 - .../client/examples/AttachExample.java | 77 - .../client/examples/CertManagerExample.java | 45 - .../client/examples/ControllerExample.java | 163 - .../client/examples/CopyExample.java | 51 - .../client/examples/DynamicClientExample.java | 42 - .../kubernetes/client/examples/Example.java | 44 - .../client/examples/ExecExample.java | 96 - .../client/examples/ExpandedExample.java | 274 - .../client/examples/FluentExample.java | 75 - .../client/examples/GenericClientExample.java | 63 - .../examples/InClusterClientExample.java | 58 - .../client/examples/InformerExample.java | 106 - .../examples/KubeConfigFileClientExample.java | 58 - .../client/examples/KubectlExample.java | 311 - .../examples/LeaderElectionExample.java | 56 - .../client/examples/LogsExample.java | 51 - .../client/examples/MetricsExample.java | 68 - .../client/examples/PagerExample.java | 72 - .../client/examples/ParseExample.java | 64 - .../client/examples/PatchExample.java | 129 - .../client/examples/PortForwardExample.java | 87 - .../client/examples/PromOpExample.java | 43 - .../client/examples/PrometheusExample.java | 66 - .../client/examples/ProtoExample.java | 69 - .../examples/SpringControllerExample.java | 147 - .../examples/SpringLoadBalancerExample.java | 68 - .../client/examples/WatchExample.java | 54 - .../client/examples/WebSocketsExample.java | 74 - .../client/examples/YamlExample.java | 109 - .../src/main/resources/application.properties | 2 - .../client/examples/ExampleTest.java | 55 - examples/examples-release-17/test-svc.yaml | 11 - examples/examples-release-17/test.yaml | 16 - examples/examples-release-18/Dockerfile | 7 - examples/examples-release-18/README.md | 13 - examples/examples-release-18/createPod.sh | 26 - examples/examples-release-18/pom.xml | 118 - .../client/examples/AttachExample.java | 77 - .../client/examples/CertManagerExample.java | 45 - .../client/examples/ControllerExample.java | 163 - .../client/examples/CopyExample.java | 51 - .../examples/DeployRolloutRestartExample.java | 140 - .../client/examples/DynamicClientExample.java | 42 - .../kubernetes/client/examples/Example.java | 44 - .../client/examples/ExecExample.java | 96 - .../client/examples/ExpandedExample.java | 274 - .../client/examples/FluentExample.java | 75 - .../client/examples/GenericClientExample.java | 63 - .../examples/InClusterClientExample.java | 58 - .../client/examples/InformerExample.java | 106 - .../examples/KubeConfigFileClientExample.java | 58 - .../client/examples/KubectlExample.java | 311 - .../examples/LeaderElectionExample.java | 56 - .../client/examples/LogsExample.java | 51 - .../client/examples/MetricsExample.java | 68 - .../client/examples/PagerExample.java | 72 - .../client/examples/ParseExample.java | 64 - .../client/examples/PatchExample.java | 130 - .../client/examples/PortForwardExample.java | 87 - .../client/examples/PromOpExample.java | 43 - .../client/examples/PrometheusExample.java | 66 - .../client/examples/ProtoExample.java | 69 - .../examples/SpringControllerExample.java | 147 - .../examples/SpringLoadBalancerExample.java | 68 - .../client/examples/WatchExample.java | 54 - .../client/examples/WebSocketsExample.java | 74 - .../client/examples/YamlExample.java | 109 - .../src/main/resources/application.properties | 2 - .../client/examples/ExampleTest.java | 55 - examples/examples-release-18/test-svc.yaml | 11 - examples/examples-release-18/test.yaml | 16 - examples/examples-release-19/Dockerfile | 7 - examples/examples-release-19/README.md | 13 - examples/examples-release-19/createPod.sh | 26 - examples/examples-release-19/pom.xml | 110 - .../client/examples/AttachExample.java | 77 - .../client/examples/CertManagerExample.java | 45 - .../client/examples/ControllerExample.java | 164 - .../client/examples/CopyExample.java | 51 - .../examples/DeployRolloutRestartExample.java | 140 - .../client/examples/DynamicClientExample.java | 42 - .../examples/EKSAuthenticationExample.java | 53 - .../kubernetes/client/examples/Example.java | 44 - .../client/examples/ExecExample.java | 96 - .../client/examples/ExpandedExample.java | 278 - .../client/examples/FluentExample.java | 75 - .../client/examples/GenericClientExample.java | 63 - .../examples/InClusterClientExample.java | 58 - .../client/examples/InformerExample.java | 107 - .../examples/KubeConfigFileClientExample.java | 58 - .../client/examples/KubectlExample.java | 311 - .../examples/LeaderElectionExample.java | 56 - .../client/examples/LogsExample.java | 51 - .../client/examples/MetricsExample.java | 68 - .../client/examples/PagerExample.java | 73 - .../client/examples/ParseExample.java | 64 - .../client/examples/PatchExample.java | 130 - .../client/examples/PortForwardExample.java | 87 - .../client/examples/PromOpExample.java | 43 - .../client/examples/PrometheusExample.java | 66 - .../client/examples/ProtoExample.java | 69 - .../examples/SpringControllerExample.java | 147 - .../examples/SpringLoadBalancerExample.java | 68 - .../client/examples/WatchExample.java | 54 - .../client/examples/WebSocketsExample.java | 74 - .../client/examples/YamlExample.java | 110 - .../src/main/resources/application.properties | 2 - .../client/examples/ExampleTest.java | 55 - examples/examples-release-19/test-svc.yaml | 11 - examples/examples-release-19/test.yaml | 16 - .../V1alpha1GroupVersionResourceBuilder.java | 34 - .../V1alpha1GroupVersionResourceFluent.java | 122 - .../V1alpha1MigrationConditionBuilder.java | 36 - .../V1alpha1MigrationConditionFluent.java | 169 - .../V1alpha1PodCertificateRequestBuilder.java | 36 - .../V1alpha1PodCertificateRequestFluent.java | 298 - ...lpha1PodCertificateRequestListBuilder.java | 35 - ...alpha1PodCertificateRequestListFluent.java | 408 - ...lpha1PodCertificateRequestSpecBuilder.java | 41 - ...alpha1PodCertificateRequestSpecFluent.java | 434 - ...ha1PodCertificateRequestStatusBuilder.java | 36 - ...pha1PodCertificateRequestStatusFluent.java | 388 - ...1alpha1StorageVersionMigrationBuilder.java | 36 - ...V1alpha1StorageVersionMigrationFluent.java | 298 - ...ha1StorageVersionMigrationListBuilder.java | 35 - ...pha1StorageVersionMigrationListFluent.java | 408 - ...ha1StorageVersionMigrationSpecBuilder.java | 33 - ...pha1StorageVersionMigrationSpecFluent.java | 143 - ...1StorageVersionMigrationStatusBuilder.java | 33 - ...a1StorageVersionMigrationStatusFluent.java | 318 - .../V1alpha1VolumeAttributesClassBuilder.java | 36 - .../V1alpha1VolumeAttributesClassFluent.java | 262 - ...lpha1VolumeAttributesClassListBuilder.java | 35 - ...alpha1VolumeAttributesClassListFluent.java | 408 - .../V1alpha3CELDeviceSelectorBuilder.java | 32 - .../V1alpha3CELDeviceSelectorFluent.java | 76 - .../models/V1alpha3DeviceSelectorBuilder.java | 32 - .../models/V1alpha3DeviceSelectorFluent.java | 120 - kubernetes/docs/StorageV1alpha1Api.md | 671 - .../docs/StoragemigrationV1alpha1Api.md | 910 - .../docs/V1alpha1GroupVersionResource.md | 15 - kubernetes/docs/V1alpha1MigrationCondition.md | 17 - .../docs/V1alpha1PodCertificateRequest.md | 21 - .../docs/V1alpha1PodCertificateRequestList.md | 20 - .../docs/V1alpha1PodCertificateRequestSpec.md | 22 - .../V1alpha1PodCertificateRequestStatus.md | 17 - .../docs/V1alpha1StorageVersionMigration.md | 21 - .../V1alpha1StorageVersionMigrationList.md | 20 - .../V1alpha1StorageVersionMigrationSpec.md | 14 - .../V1alpha1StorageVersionMigrationStatus.md | 14 - .../docs/V1alpha1VolumeAttributesClass.md | 21 - .../docs/V1alpha1VolumeAttributesClassList.md | 20 - kubernetes/docs/V1alpha3CELDeviceSelector.md | 13 - kubernetes/docs/V1alpha3DeviceSelector.md | 13 - .../openapi/apis/StorageV1alpha1Api.java | 1356 -- .../apis/StoragemigrationV1alpha1Api.java | 1807 -- .../models/V1alpha1GroupVersionResource.java | 156 - .../models/V1alpha1MigrationCondition.java | 213 - .../models/V1alpha1PodCertificateRequest.java | 216 - .../V1alpha1PodCertificateRequestList.java | 193 - .../V1alpha1PodCertificateRequestSpec.java | 350 - .../V1alpha1PodCertificateRequestStatus.java | 226 - .../V1alpha1StorageVersionMigration.java | 217 - .../V1alpha1StorageVersionMigrationList.java | 193 - .../V1alpha1StorageVersionMigrationSpec.java | 127 - ...V1alpha1StorageVersionMigrationStatus.java | 138 - .../models/V1alpha1VolumeAttributesClass.java | 225 - .../V1alpha1VolumeAttributesClassList.java | 193 - .../models/V1alpha3CELDeviceSelector.java | 97 - .../models/V1alpha3DeviceSelector.java | 99 - .../client/proto/V1alpha1Admission.java | 5194 ------ .../proto/V1alpha1Admissionregistration.java | 14647 ---------------- .../client/proto/V1alpha1Settings.java | 5571 ------ .../client/proto/V2alpha1Batch.java | 8443 --------- .../AzureActiveDirectoryAuthenticator.java | 84 - .../client/util/eks/AWS4STSSigner.java | 141 - .../client/util/eks/AWS4SignerBase.java | 256 - .../client/util/eks/BinaryUtils.java | 65 - .../kubernetes/client/util/eks/HttpUtils.java | 121 - 375 files changed, 87641 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/library-scripts/README.md delete mode 100755 .devcontainer/library-scripts/common-debian.sh delete mode 100644 .devcontainer/library-scripts/node-debian.sh delete mode 100644 .devcontainer/maven-settings.xml delete mode 100644 .mvn/wrapper/MavenWrapperDownloader.java delete mode 100644 client-java-contrib/Dockerfile.gen delete mode 100644 client-java-contrib/Dockerfile.gen-base delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java delete mode 100644 client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy delete mode 100644 e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy delete mode 100644 examples/examples-release-16/Dockerfile delete mode 100644 examples/examples-release-16/README.md delete mode 100755 examples/examples-release-16/createPod.sh delete mode 100644 examples/examples-release-16/pom.xml delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java delete mode 100644 examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java delete mode 100644 examples/examples-release-16/src/main/resources/application.properties delete mode 100644 examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java delete mode 100644 examples/examples-release-16/test-svc.yaml delete mode 100644 examples/examples-release-16/test.yaml delete mode 100644 examples/examples-release-17/Dockerfile delete mode 100644 examples/examples-release-17/README.md delete mode 100755 examples/examples-release-17/createPod.sh delete mode 100644 examples/examples-release-17/pom.xml delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java delete mode 100644 examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java delete mode 100644 examples/examples-release-17/src/main/resources/application.properties delete mode 100644 examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java delete mode 100644 examples/examples-release-17/test-svc.yaml delete mode 100644 examples/examples-release-17/test.yaml delete mode 100644 examples/examples-release-18/Dockerfile delete mode 100644 examples/examples-release-18/README.md delete mode 100755 examples/examples-release-18/createPod.sh delete mode 100644 examples/examples-release-18/pom.xml delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java delete mode 100644 examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java delete mode 100644 examples/examples-release-18/src/main/resources/application.properties delete mode 100644 examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java delete mode 100644 examples/examples-release-18/test-svc.yaml delete mode 100644 examples/examples-release-18/test.yaml delete mode 100644 examples/examples-release-19/Dockerfile delete mode 100644 examples/examples-release-19/README.md delete mode 100755 examples/examples-release-19/createPod.sh delete mode 100644 examples/examples-release-19/pom.xml delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java delete mode 100644 examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java delete mode 100644 examples/examples-release-19/src/main/resources/application.properties delete mode 100644 examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java delete mode 100644 examples/examples-release-19/test-svc.yaml delete mode 100644 examples/examples-release-19/test.yaml delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java delete mode 100644 fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java delete mode 100644 kubernetes/docs/StorageV1alpha1Api.md delete mode 100644 kubernetes/docs/StoragemigrationV1alpha1Api.md delete mode 100644 kubernetes/docs/V1alpha1GroupVersionResource.md delete mode 100644 kubernetes/docs/V1alpha1MigrationCondition.md delete mode 100644 kubernetes/docs/V1alpha1PodCertificateRequest.md delete mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestList.md delete mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestSpec.md delete mode 100644 kubernetes/docs/V1alpha1PodCertificateRequestStatus.md delete mode 100644 kubernetes/docs/V1alpha1StorageVersionMigration.md delete mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationList.md delete mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md delete mode 100644 kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md delete mode 100644 kubernetes/docs/V1alpha1VolumeAttributesClass.md delete mode 100644 kubernetes/docs/V1alpha1VolumeAttributesClassList.md delete mode 100644 kubernetes/docs/V1alpha3CELDeviceSelector.md delete mode 100644 kubernetes/docs/V1alpha3DeviceSelector.md delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java delete mode 100644 kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java delete mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java delete mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java delete mode 100644 proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java delete mode 100644 proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java delete mode 100644 util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java delete mode 100644 util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java delete mode 100644 util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java delete mode 100644 util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java delete mode 100644 util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 63180e09f3..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,67 +0,0 @@ -# Update the VARIANT arg in devcontainer.json to pick a Java version >= 11 -ARG VARIANT=11 -FROM openjdk:${VARIANT}-jdk-buster - -# Options for setup script -ARG INSTALL_ZSH="true" -ARG UPGRADE_PACKAGES="false" -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. -COPY library-scripts/*.sh /tmp/library-scripts/ -RUN apt-get update \ - && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts - -# [Optional] Install Maven -ARG INSTALL_MAVEN="false" -ARG MAVEN_VERSION=3.6.3 -ARG MAVEN_DOWNLOAD_SHA="dev-mode" -ENV MAVEN_HOME /usr/share/maven \ - MAVEN_CONFIG /root/.m2 -COPY maven-settings.xml /usr/share/maven/ref/ -RUN if [ "${INSTALL_MAVEN}" = "true" ]; then \ - mkdir -p /usr/share/maven /usr/share/maven/ref \ - && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ - && ([ "${MAVEN_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${MAVEN_DOWNLOAD_SHA} */tmp/apache-maven.tar.gz" | sha512sum -c - ) \ - && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ - && rm -f /tmp/apache-maven.tar.gz \ - && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn; \ - fi - -# [Optional] Install Gradle -ARG INSTALL_GRADLE="false" -ARG GRADLE_VERSION=5.4.1 -ARG GRADLE_DOWNLOAD_SHA="dev-mode" -ENV GRADLE_HOME=/opt/gradle -RUN if [ "${INSTALL_GRADLE}" = "true" ]; then \ - curl -sSL --output gradle.zip "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \ - && ([ "${GRADLE_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${GRADLE_DOWNLOAD_SHA} *gradle.zip" | sha256sum --check - ) \ - && unzip gradle.zip \ - && rm gradle.zip \ - && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle; \ - fi - -# Allow for a consistant java home location for settings - image is changing over time -RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi - -# [Optional] Install Node.js for use with web applications - update the INSTALL_NODE arg in devcontainer.json to enable. -ARG INSTALL_NODE="false" -ARG NODE_VERSION="lts/*" -ENV NVM_DIR=/usr/local/share/nvm \ - NVM_SYMLINK_CURRENT=true \ - PATH=${NVM_DIR}/current/bin:${PATH} -COPY library-scripts/node-debian.sh /tmp/library-scripts/ -RUN if [ "$INSTALL_NODE" = "true" ]; then \ - /bin/bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ - fi \ - && rm -rf /tmp/library-scripts - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update \ -# && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends \ No newline at end of file diff --git a/.devcontainer/library-scripts/README.md b/.devcontainer/library-scripts/README.md deleted file mode 100644 index d06dfd1a95..0000000000 --- a/.devcontainer/library-scripts/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Warning: Folder contents may be replaced - -The contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged. - -To retain your edits, move the file to a different location. You may also delete the files if they are not needed. \ No newline at end of file diff --git a/.devcontainer/library-scripts/common-debian.sh b/.devcontainer/library-scripts/common-debian.sh deleted file mode 100755 index ffef7ba2d4..0000000000 --- a/.devcontainer/library-scripts/common-debian.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -# Syntax: ./common-debian.sh - -set -e - -INSTALL_ZSH=${1:-"true"} -USERNAME=${2:-"$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)"} -USER_UID=${3:-1000} -USER_GID=${4:-1000} -UPGRADE_PACKAGES=${5:-"true"} - -if [ "$(id -u)" -ne 0 ]; then - echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' - exit 1 -fi - -# Treat a user name of "none" as root -if [ "${USERNAME}" = "none" ] || [ "${USERNAME}" = "root" ]; then - USERNAME=root - USER_UID=0 - USER_GID=0 -fi - -# Ensure apt is in non-interactive to avoid prompts -export DEBIAN_FRONTEND=noninteractive - -# Install apt-utils to avoid debconf warning -apt-get -y install --no-install-recommends apt-utils 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 ) - -# Get to latest versions of all packages -if [ "${UPGRADE_PACKAGES}" = "true" ]; then - apt-get -y upgrade --no-install-recommends -fi - -# Install common developer tools and dependencies -apt-get -y install --no-install-recommends \ - git \ - openssh-client \ - less \ - iproute2 \ - procps \ - curl \ - wget \ - unzip \ - nano \ - jq \ - lsb-release \ - ca-certificates \ - apt-transport-https \ - dialog \ - gnupg2 \ - libc6 \ - libgcc1 \ - libgssapi-krb5-2 \ - libicu[0-9][0-9] \ - liblttng-ust0 \ - libstdc++6 \ - zlib1g \ - locales - -# Ensure at least the en_US.UTF-8 UTF-8 locale is available. -# Common need for both applications and things like the agnoster ZSH theme. -echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen -locale-gen - -# Install libssl1.1 if available -if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then - apt-get -y install --no-install-recommends libssl1.1 -fi - -# Install appropriate version of libssl1.0.x if available -LIBSSL=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '') -if [ "$(echo "$LIBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then - if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then - # Debian 9 - apt-get -y install --no-install-recommends libssl1.0.2 - elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then - # Ubuntu 18.04, 16.04, earlier - apt-get -y install --no-install-recommends libssl1.0.0 - fi -fi - -# Create or update a non-root user to match UID/GID - see https://aka.ms/vscode-remote/containers/non-root-user. -if id -u $USERNAME > /dev/null 2>&1; then - # User exists, update if needed - if [ "$USER_GID" != "$(id -G $USERNAME)" ]; then - groupmod --gid $USER_GID $USERNAME - usermod --gid $USER_GID $USERNAME - fi - if [ "$USER_UID" != "$(id -u $USERNAME)" ]; then - usermod --uid $USER_UID $USERNAME - fi -else - # Create user - groupadd --gid $USER_GID $USERNAME - useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME -fi - -# Add add sudo support for non-root user -apt-get install -y sudo -echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME -chmod 0440 /etc/sudoers.d/$USERNAME - -# Ensure ~/.local/bin is in the PATH for root and non-root users for bash. (zsh is later) -echo "export PATH=\$PATH:\$HOME/.local/bin" | tee -a /root/.bashrc >> /home/$USERNAME/.bashrc -chown $USER_UID:$USER_GID /home/$USERNAME/.bashrc - -# Optionally install and configure zsh -if [ "$INSTALL_ZSH" = "true" ] && [ ! -d "/root/.oh-my-zsh" ]; then - apt-get install -y zsh - sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - echo "export PATH=\$PATH:\$HOME/.local/bin" >> /root/.zshrc - cp -R /root/.oh-my-zsh /home/$USERNAME - cp /root/.zshrc /home/$USERNAME - sed -i -e "s/\/root\/.oh-my-zsh/\/home\/$USERNAME\/.oh-my-zsh/g" /home/$USERNAME/.zshrc - chown -R $USER_UID:$USER_GID /home/$USERNAME/.oh-my-zsh /home/$USERNAME/.zshrc -fi - diff --git a/.devcontainer/library-scripts/node-debian.sh b/.devcontainer/library-scripts/node-debian.sh deleted file mode 100644 index 306fcd0120..0000000000 --- a/.devcontainer/library-scripts/node-debian.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -# Syntax: ./node-debian.sh - -set -e - -export NVM_DIR=${1:-"/usr/local/share/nvm"} -export NODE_VERSION=${2:-"lts/*"} -NONROOT_USER=${3:-"vscode"} - -if [ "$(id -u)" -ne 0 ]; then - echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' - exit 1 -fi - -# Ensure apt is in non-interactive to avoid prompts -export DEBIAN_FRONTEND=noninteractive - -if [ "${NODE_VERSION}" = "none" ]; then - export NODE_VERSION= -fi - -# Install NVM -mkdir -p ${NVM_DIR} -curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 2>&1 -if [ "${NODE_VERSION}" != "" ]; then - /bin/bash -c "source $NVM_DIR/nvm.sh && nvm alias default ${NODE_VERSION}" 2>&1 -fi - -echo -e "export NVM_DIR=\"${NVM_DIR}\"\n\ -[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\"\n\ -[ -s \"\$NVM_DIR/bash_completion\" ] && \\. \"\$NVM_DIR/bash_completion\"" \ -| tee -a /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc >> /root/.zshrc - -echo -e "if [ \"\$(stat -c '%U' \$NVM_DIR)\" != \"${NONROOT_USER}\" ]; then\n\ - sudo chown -R ${NONROOT_USER}:root \$NVM_DIR\n\ -fi" | tee -a /root/.bashrc /root/.zshrc /home/${NONROOT_USER}/.bashrc >> /home/${NONROOT_USER}/.zshrc - -chown ${NONROOT_USER}:${NONROOT_USER} /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc -chown -R ${NONROOT_USER}:root ${NVM_DIR} - -# Install yarn -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 2>/dev/null -echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get -y install --no-install-recommends yarn diff --git a/.devcontainer/maven-settings.xml b/.devcontainer/maven-settings.xml deleted file mode 100644 index 50439abb02..0000000000 --- a/.devcontainer/maven-settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - /usr/share/maven/ref/repository - \ No newline at end of file diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100644 index b901097f2d..0000000000 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2007-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.net.*; -import java.io.*; -import java.nio.channels.*; -import java.util.Properties; - -public class MavenWrapperDownloader { - - private static final String WRAPPER_VERSION = "0.5.6"; - /** - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. - */ - private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" - + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; - - /** - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to - * use instead of the default one. - */ - private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; - - /** - * Path where the maven-wrapper.jar will be saved to. - */ - private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; - - /** - * Name of the property which should be used to override the default download url for the wrapper. - */ - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; - - public static void main(String args[]) { - System.out.println("- Downloader started"); - File baseDirectory = new File(args[0]); - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); - - // If the maven-wrapper.properties exists, read it and check if it contains a custom - // wrapperUrl parameter. - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - String url = DEFAULT_DOWNLOAD_URL; - if(mavenWrapperPropertyFile.exists()) { - FileInputStream mavenWrapperPropertyFileInputStream = null; - try { - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); - Properties mavenWrapperProperties = new Properties(); - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } catch (IOException e) { - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); - } finally { - try { - if(mavenWrapperPropertyFileInputStream != null) { - mavenWrapperPropertyFileInputStream.close(); - } - } catch (IOException e) { - // Ignore ... - } - } - } - System.out.println("- Downloading from: " + url); - - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if(!outputFile.getParentFile().exists()) { - if(!outputFile.getParentFile().mkdirs()) { - System.out.println( - "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); - } - } - System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); - try { - downloadFileFromURL(url, outputFile); - System.out.println("Done"); - System.exit(0); - } catch (Throwable e) { - System.out.println("- Error downloading"); - e.printStackTrace(); - System.exit(1); - } - } - - private static void downloadFileFromURL(String urlString, File destination) throws Exception { - if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { - String username = System.getenv("MVNW_USERNAME"); - char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); - Authenticator.setDefault(new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(username, password); - } - }); - } - URL website = new URL(urlString); - ReadableByteChannel rbc; - rbc = Channels.newChannel(website.openStream()); - FileOutputStream fos = new FileOutputStream(destination); - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); - fos.close(); - rbc.close(); - } - -} diff --git a/client-java-contrib/Dockerfile.gen b/client-java-contrib/Dockerfile.gen deleted file mode 100644 index f4959ca932..0000000000 --- a/client-java-contrib/Dockerfile.gen +++ /dev/null @@ -1,13 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/yue9944882/crd-model-gen-base:v1.0.0 -FROM ${BASE_IMAGE} -# TODO: move this to kubernetes-client group after the permission issue fixed - -ARG GENERATION_XML_FILE - -# Copy required files -COPY openapi-generator/generate_client_in_container.sh /generate_client.sh -COPY preprocess_spec.py / -COPY custom_objects_spec.json / -COPY ${GENERATION_XML_FILE} /generation_params.xml - -ENTRYPOINT ["mvn-entrypoint.sh", "/generate_client.sh"] diff --git a/client-java-contrib/Dockerfile.gen-base b/client-java-contrib/Dockerfile.gen-base deleted file mode 100644 index 2dd1af9b4e..0000000000 --- a/client-java-contrib/Dockerfile.gen-base +++ /dev/null @@ -1,43 +0,0 @@ -FROM maven:3.5-jdk-8-slim - -ARG OPENAPI_GENERATOR_COMMIT -ARG OPENAPI_GENERATOR_USER_ORG=OpenAPITools - -# Install preprocessing script requirements -RUN apt-get update && apt-get -y install git python-pip && pip install urllib3==1.24.2 - -# Install Autorest -RUN apt-get update && apt-get -qq -y install libunwind8 libicu57 libssl1.0 liblttng-ust0 libcurl3 libuuid1 libkrb5-3 zlib1g gnupg2 -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - -RUN apt-get update && apt-get -y install \ - nodejs \ - libunwind8-dev \ - && rm -rf /var/lib/apt/lists/* - -RUN npm install -g autorest@3 - -# Check out specific commit of openapi-generator -RUN mkdir /source && \ - cd /source && \ - git clone -n https://github.com/${OPENAPI_GENERATOR_USER_ORG}/openapi-generator.git && \ - cd openapi-generator && \ - git checkout $OPENAPI_GENERATOR_COMMIT - -# Build it and persist local repository -RUN mkdir /.npm && chmod -R go+rwx /.npm && chmod -R go+rwx /root && umask 0 && cd /source/openapi-generator && \ - mvn install -DskipTests -Dmaven.test.skip=true -pl modules/openapi-generator-maven-plugin -am && \ - cp -r /root/.m2/* /usr/share/maven/ref - -RUN mkdir -p /node_modules && chmod -R go+rwx /node_modules -RUN npm install @microsoft.azure/autorest.csharp \ - @microsoft.azure/autorest.modeler - -RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg -RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ -RUN curl https://packages.microsoft.com/config/debian/9/prod.list > prod.list -RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list -RUN chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg -RUN chown root:root /etc/apt/sources.list.d/microsoft-prod.list - -RUN apt-get update -RUN apt-get install -yy -q dotnet-hosting-2.0.8 \ No newline at end of file diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java deleted file mode 100644 index 1f8bd203ca..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Certificate.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A Certificate resource should be created to ensure an up to date and signed x509 certificate is - * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored - * certificate will be renewed before it expires (as configured by `spec.renewBefore`). - */ -@ApiModel( - description = - "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2Certificate implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2CertificateSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateStatus status; - - public V1alpha2Certificate apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2Certificate kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2Certificate metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2Certificate spec(V1alpha2CertificateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2CertificateSpec spec) { - this.spec = spec; - } - - public V1alpha2Certificate status(V1beta1CertificateStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2Certificate v1alpha2Certificate = (V1alpha2Certificate) o; - return Objects.equals(this.apiVersion, v1alpha2Certificate.apiVersion) - && Objects.equals(this.kind, v1alpha2Certificate.kind) - && Objects.equals(this.metadata, v1alpha2Certificate.metadata) - && Objects.equals(this.spec, v1alpha2Certificate.spec) - && Objects.equals(this.status, v1alpha2Certificate.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2Certificate {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java deleted file mode 100644 index 26a58fb11e..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateList is a list of Certificate */ -@ApiModel(description = "CertificateList is a list of Certificate") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2CertificateList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2CertificateList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2CertificateList addItemsItem(V1alpha2Certificate itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificates. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2CertificateList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2CertificateList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateList v1alpha2CertificateList = (V1alpha2CertificateList) o; - return Objects.equals(this.apiVersion, v1alpha2CertificateList.apiVersion) - && Objects.equals(this.items, v1alpha2CertificateList.items) - && Objects.equals(this.kind, v1alpha2CertificateList.kind) - && Objects.equals(this.metadata, v1alpha2CertificateList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java deleted file mode 100644 index fbc0ba0728..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A CertificateRequest is used to request a signed certificate from one of the configured issuers. - * All fields within the CertificateRequest's `spec` are immutable after creation. A - * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. - * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in - * time request for a certificate and cannot be re-used. - */ -@ApiModel( - description = - "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateRequest implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2CertificateRequestSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateRequestStatus status; - - public V1alpha2CertificateRequest apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2CertificateRequest kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2CertificateRequest metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2CertificateRequest spec(V1alpha2CertificateRequestSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateRequestSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2CertificateRequestSpec spec) { - this.spec = spec; - } - - public V1alpha2CertificateRequest status(V1beta1CertificateRequestStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateRequestStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateRequestStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateRequest v1alpha2CertificateRequest = (V1alpha2CertificateRequest) o; - return Objects.equals(this.apiVersion, v1alpha2CertificateRequest.apiVersion) - && Objects.equals(this.kind, v1alpha2CertificateRequest.kind) - && Objects.equals(this.metadata, v1alpha2CertificateRequest.metadata) - && Objects.equals(this.spec, v1alpha2CertificateRequest.spec) - && Objects.equals(this.status, v1alpha2CertificateRequest.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateRequest {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java deleted file mode 100644 index 2b32c2d267..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestList.java +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateRequestList is a list of CertificateRequest */ -@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateRequestList - implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2CertificateRequestList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2CertificateRequestList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2CertificateRequestList addItemsItem(V1alpha2CertificateRequest itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificaterequests. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2CertificateRequestList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2CertificateRequestList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateRequestList v1alpha2CertificateRequestList = - (V1alpha2CertificateRequestList) o; - return Objects.equals(this.apiVersion, v1alpha2CertificateRequestList.apiVersion) - && Objects.equals(this.items, v1alpha2CertificateRequestList.items) - && Objects.equals(this.kind, v1alpha2CertificateRequestList.kind) - && Objects.equals(this.metadata, v1alpha2CertificateRequestList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateRequestList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java deleted file mode 100644 index 2a731ad9da..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateRequestSpec.java +++ /dev/null @@ -1,328 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** Desired state of the CertificateRequest resource. */ -@ApiModel(description = "Desired state of the CertificateRequest resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateRequestSpec { - public static final String SERIALIZED_NAME_CSR = "csr"; - - @SerializedName(SERIALIZED_NAME_CSR) - private byte[] csr; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_IS_C_A = "isCA"; - - @SerializedName(SERIALIZED_NAME_IS_C_A) - private Boolean isCA; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1CertificateRequestSpecIssuerRef issuerRef; - - /** - * KeyUsage specifies valid usage contexts for keys. See: - * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: - * \"signing\", \"digital signature\", \"content commitment\", - * \"key encipherment\", \"key agreement\", \"data encipherment\", - * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher - * only\", \"any\", \"server auth\", \"client auth\", - * \"code signing\", \"email protection\", \"s/mime\", \"ipsec - * end system\", \"ipsec tunnel\", \"ipsec user\", - * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", - * \"netscape sgc\" - */ - @JsonAdapter(UsagesEnum.Adapter.class) - public enum UsagesEnum { - SIGNING("signing"), - - DIGITAL_SIGNATURE("digital signature"), - - CONTENT_COMMITMENT("content commitment"), - - KEY_ENCIPHERMENT("key encipherment"), - - KEY_AGREEMENT("key agreement"), - - DATA_ENCIPHERMENT("data encipherment"), - - CERT_SIGN("cert sign"), - - CRL_SIGN("crl sign"), - - ENCIPHER_ONLY("encipher only"), - - DECIPHER_ONLY("decipher only"), - - ANY("any"), - - SERVER_AUTH("server auth"), - - CLIENT_AUTH("client auth"), - - CODE_SIGNING("code signing"), - - EMAIL_PROTECTION("email protection"), - - S_MIME("s/mime"), - - IPSEC_END_SYSTEM("ipsec end system"), - - IPSEC_TUNNEL("ipsec tunnel"), - - IPSEC_USER("ipsec user"), - - TIMESTAMPING("timestamping"), - - OCSP_SIGNING("ocsp signing"), - - MICROSOFT_SGC("microsoft sgc"), - - NETSCAPE_SGC("netscape sgc"); - - private String value; - - UsagesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UsagesEnum fromValue(String value) { - for (UsagesEnum b : UsagesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UsagesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UsagesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_USAGES = "usages"; - - @SerializedName(SERIALIZED_NAME_USAGES) - private List usages = null; - - public V1alpha2CertificateRequestSpec csr(byte[] csr) { - - this.csr = csr; - return this; - } - - /** - * The PEM-encoded x509 certificate signing request to be submitted to the CA for signing. - * - * @return csr - */ - @ApiModelProperty( - required = true, - value = - "The PEM-encoded x509 certificate signing request to be submitted to the CA for signing.") - public byte[] getCsr() { - return csr; - } - - public void setCsr(byte[] csr) { - this.csr = csr; - } - - public V1alpha2CertificateRequestSpec duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be - * ignored/overridden by some issuer types. - * - * @return duration - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types.") - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public V1alpha2CertificateRequestSpec isCA(Boolean isCA) { - - this.isCA = isCA; - return this; - } - - /** - * IsCA will request to mark the certificate as valid for certificate signing when submitting to - * the issuer. This will automatically add the `cert sign` usage to the list of - * `usages`. - * - * @return isCA - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "IsCA will request to mark the certificate as valid for certificate signing when submitting to the issuer. This will automatically add the `cert sign` usage to the list of `usages`.") - public Boolean getIsCA() { - return isCA; - } - - public void setIsCA(Boolean isCA) { - this.isCA = isCA; - } - - public V1alpha2CertificateRequestSpec issuerRef( - V1beta1CertificateRequestSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateRequestSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1alpha2CertificateRequestSpec usages(List usages) { - - this.usages = usages; - return this; - } - - public V1alpha2CertificateRequestSpec addUsagesItem(UsagesEnum usagesItem) { - if (this.usages == null) { - this.usages = new ArrayList(); - } - this.usages.add(usagesItem); - return this; - } - - /** - * Usages is the set of x509 usages that are requested for the certificate. Defaults to - * `digital signature` and `key encipherment` if not specified. - * - * @return usages - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") - public List getUsages() { - return usages; - } - - public void setUsages(List usages) { - this.usages = usages; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateRequestSpec v1alpha2CertificateRequestSpec = - (V1alpha2CertificateRequestSpec) o; - return Arrays.equals(this.csr, v1alpha2CertificateRequestSpec.csr) - && Objects.equals(this.duration, v1alpha2CertificateRequestSpec.duration) - && Objects.equals(this.isCA, v1alpha2CertificateRequestSpec.isCA) - && Objects.equals(this.issuerRef, v1alpha2CertificateRequestSpec.issuerRef) - && Objects.equals(this.usages, v1alpha2CertificateRequestSpec.usages); - } - - @Override - public int hashCode() { - return Objects.hash(Arrays.hashCode(csr), duration, isCA, issuerRef, usages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateRequestSpec {\n"); - sb.append(" csr: ").append(toIndentedString(csr)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java deleted file mode 100644 index 8e3258535a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpec.java +++ /dev/null @@ -1,886 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Desired state of the Certificate resource. */ -@ApiModel(description = "Desired state of the Certificate resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateSpec { - public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; - - @SerializedName(SERIALIZED_NAME_COMMON_NAME) - private String commonName; - - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = null; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; - - @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) - private List emailSANs = null; - - public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; - - @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) - private List ipAddresses = null; - - public static final String SERIALIZED_NAME_IS_C_A = "isCA"; - - @SerializedName(SERIALIZED_NAME_IS_C_A) - private Boolean isCA; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1CertificateSpecIssuerRef issuerRef; - - /** - * KeyAlgorithm is the private key algorithm of the corresponding private key for this - * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 - * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - */ - @JsonAdapter(KeyAlgorithmEnum.Adapter.class) - public enum KeyAlgorithmEnum { - RSA("rsa"), - - ECDSA("ecdsa"); - - private String value; - - KeyAlgorithmEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyAlgorithmEnum fromValue(String value) { - for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyAlgorithmEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; - - @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) - private KeyAlgorithmEnum keyAlgorithm; - - /** - * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private - * key to be encoded in. If provided, allowed values are \"pkcs1\" and - * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not - * specified, then PKCS#1 will be used by default. - */ - @JsonAdapter(KeyEncodingEnum.Adapter.class) - public enum KeyEncodingEnum { - PKCS1("pkcs1"), - - PKCS8("pkcs8"); - - private String value; - - KeyEncodingEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyEncodingEnum fromValue(String value) { - for (KeyEncodingEnum b : KeyEncodingEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyEncodingEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyEncodingEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyEncodingEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KEY_ENCODING = "keyEncoding"; - - @SerializedName(SERIALIZED_NAME_KEY_ENCODING) - private KeyEncodingEnum keyEncoding; - - public static final String SERIALIZED_NAME_KEY_SIZE = "keySize"; - - @SerializedName(SERIALIZED_NAME_KEY_SIZE) - private Integer keySize; - - public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; - - @SerializedName(SERIALIZED_NAME_KEYSTORES) - private V1beta1CertificateSpecKeystores keystores; - - public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; - - @SerializedName(SERIALIZED_NAME_ORGANIZATION) - private List organization = null; - - public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; - - @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) - private V1alpha2CertificateSpecPrivateKey privateKey; - - public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; - - @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) - private String renewBefore; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - - @SerializedName(SERIALIZED_NAME_SUBJECT) - private V1alpha2CertificateSpecSubject subject; - - public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; - - @SerializedName(SERIALIZED_NAME_URI_S_A_NS) - private List uriSANs = null; - - /** - * KeyUsage specifies valid usage contexts for keys. See: - * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: - * \"signing\", \"digital signature\", \"content commitment\", - * \"key encipherment\", \"key agreement\", \"data encipherment\", - * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher - * only\", \"any\", \"server auth\", \"client auth\", - * \"code signing\", \"email protection\", \"s/mime\", \"ipsec - * end system\", \"ipsec tunnel\", \"ipsec user\", - * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", - * \"netscape sgc\" - */ - @JsonAdapter(UsagesEnum.Adapter.class) - public enum UsagesEnum { - SIGNING("signing"), - - DIGITAL_SIGNATURE("digital signature"), - - CONTENT_COMMITMENT("content commitment"), - - KEY_ENCIPHERMENT("key encipherment"), - - KEY_AGREEMENT("key agreement"), - - DATA_ENCIPHERMENT("data encipherment"), - - CERT_SIGN("cert sign"), - - CRL_SIGN("crl sign"), - - ENCIPHER_ONLY("encipher only"), - - DECIPHER_ONLY("decipher only"), - - ANY("any"), - - SERVER_AUTH("server auth"), - - CLIENT_AUTH("client auth"), - - CODE_SIGNING("code signing"), - - EMAIL_PROTECTION("email protection"), - - S_MIME("s/mime"), - - IPSEC_END_SYSTEM("ipsec end system"), - - IPSEC_TUNNEL("ipsec tunnel"), - - IPSEC_USER("ipsec user"), - - TIMESTAMPING("timestamping"), - - OCSP_SIGNING("ocsp signing"), - - MICROSOFT_SGC("microsoft sgc"), - - NETSCAPE_SGC("netscape sgc"); - - private String value; - - UsagesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UsagesEnum fromValue(String value) { - for (UsagesEnum b : UsagesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UsagesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UsagesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_USAGES = "usages"; - - @SerializedName(SERIALIZED_NAME_USAGES) - private List usages = null; - - public V1alpha2CertificateSpec commonName(String commonName) { - - this.commonName = commonName; - return this; - } - - /** - * CommonName is a common name to be used on the Certificate. The CommonName should have a length - * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS - * clients when any subject alt name is set. This is x509 behaviour: - * https://tools.ietf.org/html/rfc6125#section-6.4.4 - * - * @return commonName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") - public String getCommonName() { - return commonName; - } - - public void setCommonName(String commonName) { - this.commonName = commonName; - } - - public V1alpha2CertificateSpec dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1alpha2CertificateSpec addDnsNamesItem(String dnsNamesItem) { - if (this.dnsNames == null) { - this.dnsNames = new ArrayList(); - } - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. - * - * @return dnsNames - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1alpha2CertificateSpec duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be - * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater - * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of - * the way through the certificate's duration. - * - * @return duration - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public V1alpha2CertificateSpec emailSANs(List emailSANs) { - - this.emailSANs = emailSANs; - return this; - } - - public V1alpha2CertificateSpec addEmailSANsItem(String emailSANsItem) { - if (this.emailSANs == null) { - this.emailSANs = new ArrayList(); - } - this.emailSANs.add(emailSANsItem); - return this; - } - - /** - * EmailSANs is a list of email subjectAltNames to be set on the Certificate. - * - * @return emailSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") - public List getEmailSANs() { - return emailSANs; - } - - public void setEmailSANs(List emailSANs) { - this.emailSANs = emailSANs; - } - - public V1alpha2CertificateSpec ipAddresses(List ipAddresses) { - - this.ipAddresses = ipAddresses; - return this; - } - - public V1alpha2CertificateSpec addIpAddressesItem(String ipAddressesItem) { - if (this.ipAddresses == null) { - this.ipAddresses = new ArrayList(); - } - this.ipAddresses.add(ipAddressesItem); - return this; - } - - /** - * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. - * - * @return ipAddresses - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") - public List getIpAddresses() { - return ipAddresses; - } - - public void setIpAddresses(List ipAddresses) { - this.ipAddresses = ipAddresses; - } - - public V1alpha2CertificateSpec isCA(Boolean isCA) { - - this.isCA = isCA; - return this; - } - - /** - * IsCA will mark this Certificate as valid for certificate signing. This will automatically add - * the `cert sign` usage to the list of `usages`. - * - * @return isCA - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") - public Boolean getIsCA() { - return isCA; - } - - public void setIsCA(Boolean isCA) { - this.isCA = isCA; - } - - public V1alpha2CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1alpha2CertificateSpec keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - - this.keyAlgorithm = keyAlgorithm; - return this; - } - - /** - * KeyAlgorithm is the private key algorithm of the corresponding private key for this - * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 - * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - * - * @return keyAlgorithm - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") - public KeyAlgorithmEnum getKeyAlgorithm() { - return keyAlgorithm; - } - - public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - this.keyAlgorithm = keyAlgorithm; - } - - public V1alpha2CertificateSpec keyEncoding(KeyEncodingEnum keyEncoding) { - - this.keyEncoding = keyEncoding; - return this; - } - - /** - * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private - * key to be encoded in. If provided, allowed values are \"pkcs1\" and - * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not - * specified, then PKCS#1 will be used by default. - * - * @return keyEncoding - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not specified, then PKCS#1 will be used by default.") - public KeyEncodingEnum getKeyEncoding() { - return keyEncoding; - } - - public void setKeyEncoding(KeyEncodingEnum keyEncoding) { - this.keyEncoding = keyEncoding; - } - - public V1alpha2CertificateSpec keySize(Integer keySize) { - - this.keySize = keySize; - return this; - } - - /** - * KeySize is the key bit size of the corresponding private key for this certificate. If - * `keyAlgorithm` is set to `RSA`, valid values are `2048`, - * `4096` or `8192`, and will default to `2048` if not specified. If - * `keyAlgorithm` is set to `ECDSA`, valid values are `256`, - * `384` or `521`, and will default to `256` if not specified. No - * other values are allowed. minimum: 0 maximum: 8192 - * - * @return keySize - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeySize is the key bit size of the corresponding private key for this certificate. If `keyAlgorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `keyAlgorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") - public Integer getKeySize() { - return keySize; - } - - public void setKeySize(Integer keySize) { - this.keySize = keySize; - } - - public V1alpha2CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { - - this.keystores = keystores; - return this; - } - - /** - * Get keystores - * - * @return keystores - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecKeystores getKeystores() { - return keystores; - } - - public void setKeystores(V1beta1CertificateSpecKeystores keystores) { - this.keystores = keystores; - } - - public V1alpha2CertificateSpec organization(List organization) { - - this.organization = organization; - return this; - } - - public V1alpha2CertificateSpec addOrganizationItem(String organizationItem) { - if (this.organization == null) { - this.organization = new ArrayList(); - } - this.organization.add(organizationItem); - return this; - } - - /** - * Organization is a list of organizations to be used on the Certificate. - * - * @return organization - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Organization is a list of organizations to be used on the Certificate.") - public List getOrganization() { - return organization; - } - - public void setOrganization(List organization) { - this.organization = organization; - } - - public V1alpha2CertificateSpec privateKey(V1alpha2CertificateSpecPrivateKey privateKey) { - - this.privateKey = privateKey; - return this; - } - - /** - * Get privateKey - * - * @return privateKey - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateSpecPrivateKey getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(V1alpha2CertificateSpecPrivateKey privateKey) { - this.privateKey = privateKey; - } - - public V1alpha2CertificateSpec renewBefore(String renewBefore) { - - this.renewBefore = renewBefore; - return this; - } - - /** - * The amount of time before the currently issued certificate's `notAfter` time that - * cert-manager will begin to attempt to renew the certificate. If this value is greater than the - * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed - * 2/3rds of the way through the certificate's duration. - * - * @return renewBefore - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getRenewBefore() { - return renewBefore; - } - - public void setRenewBefore(String renewBefore) { - this.renewBefore = renewBefore; - } - - public V1alpha2CertificateSpec secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * SecretName is the name of the secret resource that will be automatically created and managed by - * this Certificate resource. It will be populated with a private key and certificate, signed by - * the denoted issuer. - * - * @return secretName - */ - @ApiModelProperty( - required = true, - value = - "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") - public String getSecretName() { - return secretName; - } - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - public V1alpha2CertificateSpec subject(V1alpha2CertificateSpecSubject subject) { - - this.subject = subject; - return this; - } - - /** - * Get subject - * - * @return subject - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateSpecSubject getSubject() { - return subject; - } - - public void setSubject(V1alpha2CertificateSpecSubject subject) { - this.subject = subject; - } - - public V1alpha2CertificateSpec uriSANs(List uriSANs) { - - this.uriSANs = uriSANs; - return this; - } - - public V1alpha2CertificateSpec addUriSANsItem(String uriSANsItem) { - if (this.uriSANs == null) { - this.uriSANs = new ArrayList(); - } - this.uriSANs.add(uriSANsItem); - return this; - } - - /** - * URISANs is a list of URI subjectAltNames to be set on the Certificate. - * - * @return uriSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") - public List getUriSANs() { - return uriSANs; - } - - public void setUriSANs(List uriSANs) { - this.uriSANs = uriSANs; - } - - public V1alpha2CertificateSpec usages(List usages) { - - this.usages = usages; - return this; - } - - public V1alpha2CertificateSpec addUsagesItem(UsagesEnum usagesItem) { - if (this.usages == null) { - this.usages = new ArrayList(); - } - this.usages.add(usagesItem); - return this; - } - - /** - * Usages is the set of x509 usages that are requested for the certificate. Defaults to - * `digital signature` and `key encipherment` if not specified. - * - * @return usages - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") - public List getUsages() { - return usages; - } - - public void setUsages(List usages) { - this.usages = usages; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateSpec v1alpha2CertificateSpec = (V1alpha2CertificateSpec) o; - return Objects.equals(this.commonName, v1alpha2CertificateSpec.commonName) - && Objects.equals(this.dnsNames, v1alpha2CertificateSpec.dnsNames) - && Objects.equals(this.duration, v1alpha2CertificateSpec.duration) - && Objects.equals(this.emailSANs, v1alpha2CertificateSpec.emailSANs) - && Objects.equals(this.ipAddresses, v1alpha2CertificateSpec.ipAddresses) - && Objects.equals(this.isCA, v1alpha2CertificateSpec.isCA) - && Objects.equals(this.issuerRef, v1alpha2CertificateSpec.issuerRef) - && Objects.equals(this.keyAlgorithm, v1alpha2CertificateSpec.keyAlgorithm) - && Objects.equals(this.keyEncoding, v1alpha2CertificateSpec.keyEncoding) - && Objects.equals(this.keySize, v1alpha2CertificateSpec.keySize) - && Objects.equals(this.keystores, v1alpha2CertificateSpec.keystores) - && Objects.equals(this.organization, v1alpha2CertificateSpec.organization) - && Objects.equals(this.privateKey, v1alpha2CertificateSpec.privateKey) - && Objects.equals(this.renewBefore, v1alpha2CertificateSpec.renewBefore) - && Objects.equals(this.secretName, v1alpha2CertificateSpec.secretName) - && Objects.equals(this.subject, v1alpha2CertificateSpec.subject) - && Objects.equals(this.uriSANs, v1alpha2CertificateSpec.uriSANs) - && Objects.equals(this.usages, v1alpha2CertificateSpec.usages); - } - - @Override - public int hashCode() { - return Objects.hash( - commonName, - dnsNames, - duration, - emailSANs, - ipAddresses, - isCA, - issuerRef, - keyAlgorithm, - keyEncoding, - keySize, - keystores, - organization, - privateKey, - renewBefore, - secretName, - subject, - uriSANs, - usages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateSpec {\n"); - sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); - sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); - sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); - sb.append(" keyEncoding: ").append(toIndentedString(keyEncoding)).append("\n"); - sb.append(" keySize: ").append(toIndentedString(keySize)).append("\n"); - sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); - sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); - sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); - sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); - sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java deleted file mode 100644 index 67650f07ef..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecPrivateKey.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Options to control private keys used for the Certificate. */ -@ApiModel(description = "Options to control private keys used for the Certificate.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateSpecPrivateKey { - public static final String SERIALIZED_NAME_ROTATION_POLICY = "rotationPolicy"; - - @SerializedName(SERIALIZED_NAME_ROTATION_POLICY) - private String rotationPolicy; - - public V1alpha2CertificateSpecPrivateKey rotationPolicy(String rotationPolicy) { - - this.rotationPolicy = rotationPolicy; - return this; - } - - /** - * RotationPolicy controls how private keys should be regenerated when a re-issuance is being - * processed. If set to Never, a private key will only be generated if one does not already exist - * in the target `spec.secretName`. If one does exists but it does not have the correct - * algorithm or size, a warning will be raised to await user intervention. If set to Always, a - * private key matching the specified requirements will be generated whenever a re-issuance - * occurs. Default is 'Never' for backward compatibility. - * - * @return rotationPolicy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility.") - public String getRotationPolicy() { - return rotationPolicy; - } - - public void setRotationPolicy(String rotationPolicy) { - this.rotationPolicy = rotationPolicy; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateSpecPrivateKey v1alpha2CertificateSpecPrivateKey = - (V1alpha2CertificateSpecPrivateKey) o; - return Objects.equals(this.rotationPolicy, v1alpha2CertificateSpecPrivateKey.rotationPolicy); - } - - @Override - public int hashCode() { - return Objects.hash(rotationPolicy); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateSpecPrivateKey {\n"); - sb.append(" rotationPolicy: ").append(toIndentedString(rotationPolicy)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java deleted file mode 100644 index 2c33b100d4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2CertificateSpecSubject.java +++ /dev/null @@ -1,317 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). */ -@ApiModel( - description = "Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2CertificateSpecSubject { - public static final String SERIALIZED_NAME_COUNTRIES = "countries"; - - @SerializedName(SERIALIZED_NAME_COUNTRIES) - private List countries = null; - - public static final String SERIALIZED_NAME_LOCALITIES = "localities"; - - @SerializedName(SERIALIZED_NAME_LOCALITIES) - private List localities = null; - - public static final String SERIALIZED_NAME_ORGANIZATIONAL_UNITS = "organizationalUnits"; - - @SerializedName(SERIALIZED_NAME_ORGANIZATIONAL_UNITS) - private List organizationalUnits = null; - - public static final String SERIALIZED_NAME_POSTAL_CODES = "postalCodes"; - - @SerializedName(SERIALIZED_NAME_POSTAL_CODES) - private List postalCodes = null; - - public static final String SERIALIZED_NAME_PROVINCES = "provinces"; - - @SerializedName(SERIALIZED_NAME_PROVINCES) - private List provinces = null; - - public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serialNumber"; - - @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) - private String serialNumber; - - public static final String SERIALIZED_NAME_STREET_ADDRESSES = "streetAddresses"; - - @SerializedName(SERIALIZED_NAME_STREET_ADDRESSES) - private List streetAddresses = null; - - public V1alpha2CertificateSpecSubject countries(List countries) { - - this.countries = countries; - return this; - } - - public V1alpha2CertificateSpecSubject addCountriesItem(String countriesItem) { - if (this.countries == null) { - this.countries = new ArrayList(); - } - this.countries.add(countriesItem); - return this; - } - - /** - * Countries to be used on the Certificate. - * - * @return countries - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Countries to be used on the Certificate.") - public List getCountries() { - return countries; - } - - public void setCountries(List countries) { - this.countries = countries; - } - - public V1alpha2CertificateSpecSubject localities(List localities) { - - this.localities = localities; - return this; - } - - public V1alpha2CertificateSpecSubject addLocalitiesItem(String localitiesItem) { - if (this.localities == null) { - this.localities = new ArrayList(); - } - this.localities.add(localitiesItem); - return this; - } - - /** - * Cities to be used on the Certificate. - * - * @return localities - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Cities to be used on the Certificate.") - public List getLocalities() { - return localities; - } - - public void setLocalities(List localities) { - this.localities = localities; - } - - public V1alpha2CertificateSpecSubject organizationalUnits(List organizationalUnits) { - - this.organizationalUnits = organizationalUnits; - return this; - } - - public V1alpha2CertificateSpecSubject addOrganizationalUnitsItem(String organizationalUnitsItem) { - if (this.organizationalUnits == null) { - this.organizationalUnits = new ArrayList(); - } - this.organizationalUnits.add(organizationalUnitsItem); - return this; - } - - /** - * Organizational Units to be used on the Certificate. - * - * @return organizationalUnits - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Organizational Units to be used on the Certificate.") - public List getOrganizationalUnits() { - return organizationalUnits; - } - - public void setOrganizationalUnits(List organizationalUnits) { - this.organizationalUnits = organizationalUnits; - } - - public V1alpha2CertificateSpecSubject postalCodes(List postalCodes) { - - this.postalCodes = postalCodes; - return this; - } - - public V1alpha2CertificateSpecSubject addPostalCodesItem(String postalCodesItem) { - if (this.postalCodes == null) { - this.postalCodes = new ArrayList(); - } - this.postalCodes.add(postalCodesItem); - return this; - } - - /** - * Postal codes to be used on the Certificate. - * - * @return postalCodes - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Postal codes to be used on the Certificate.") - public List getPostalCodes() { - return postalCodes; - } - - public void setPostalCodes(List postalCodes) { - this.postalCodes = postalCodes; - } - - public V1alpha2CertificateSpecSubject provinces(List provinces) { - - this.provinces = provinces; - return this; - } - - public V1alpha2CertificateSpecSubject addProvincesItem(String provincesItem) { - if (this.provinces == null) { - this.provinces = new ArrayList(); - } - this.provinces.add(provincesItem); - return this; - } - - /** - * State/Provinces to be used on the Certificate. - * - * @return provinces - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "State/Provinces to be used on the Certificate.") - public List getProvinces() { - return provinces; - } - - public void setProvinces(List provinces) { - this.provinces = provinces; - } - - public V1alpha2CertificateSpecSubject serialNumber(String serialNumber) { - - this.serialNumber = serialNumber; - return this; - } - - /** - * Serial number to be used on the Certificate. - * - * @return serialNumber - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Serial number to be used on the Certificate.") - public String getSerialNumber() { - return serialNumber; - } - - public void setSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - } - - public V1alpha2CertificateSpecSubject streetAddresses(List streetAddresses) { - - this.streetAddresses = streetAddresses; - return this; - } - - public V1alpha2CertificateSpecSubject addStreetAddressesItem(String streetAddressesItem) { - if (this.streetAddresses == null) { - this.streetAddresses = new ArrayList(); - } - this.streetAddresses.add(streetAddressesItem); - return this; - } - - /** - * Street addresses to be used on the Certificate. - * - * @return streetAddresses - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Street addresses to be used on the Certificate.") - public List getStreetAddresses() { - return streetAddresses; - } - - public void setStreetAddresses(List streetAddresses) { - this.streetAddresses = streetAddresses; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2CertificateSpecSubject v1alpha2CertificateSpecSubject = - (V1alpha2CertificateSpecSubject) o; - return Objects.equals(this.countries, v1alpha2CertificateSpecSubject.countries) - && Objects.equals(this.localities, v1alpha2CertificateSpecSubject.localities) - && Objects.equals( - this.organizationalUnits, v1alpha2CertificateSpecSubject.organizationalUnits) - && Objects.equals(this.postalCodes, v1alpha2CertificateSpecSubject.postalCodes) - && Objects.equals(this.provinces, v1alpha2CertificateSpecSubject.provinces) - && Objects.equals(this.serialNumber, v1alpha2CertificateSpecSubject.serialNumber) - && Objects.equals(this.streetAddresses, v1alpha2CertificateSpecSubject.streetAddresses); - } - - @Override - public int hashCode() { - return Objects.hash( - countries, - localities, - organizationalUnits, - postalCodes, - provinces, - serialNumber, - streetAddresses); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2CertificateSpecSubject {\n"); - sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); - sb.append(" localities: ").append(toIndentedString(localities)).append("\n"); - sb.append(" organizationalUnits: ") - .append(toIndentedString(organizationalUnits)) - .append("\n"); - sb.append(" postalCodes: ").append(toIndentedString(postalCodes)).append("\n"); - sb.append(" provinces: ").append(toIndentedString(provinces)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" streetAddresses: ").append(toIndentedString(streetAddresses)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java deleted file mode 100644 index ba7c558157..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Challenge.java +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Challenge is a type to represent a Challenge request with an ACME server */ -@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2Challenge implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3ChallengeSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha3ChallengeStatus status; - - public V1alpha2Challenge apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2Challenge kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2Challenge metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2Challenge spec(V1alpha3ChallengeSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ChallengeSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3ChallengeSpec spec) { - this.spec = spec; - } - - public V1alpha2Challenge status(V1alpha3ChallengeStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ChallengeStatus getStatus() { - return status; - } - - public void setStatus(V1alpha3ChallengeStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2Challenge v1alpha2Challenge = (V1alpha2Challenge) o; - return Objects.equals(this.apiVersion, v1alpha2Challenge.apiVersion) - && Objects.equals(this.kind, v1alpha2Challenge.kind) - && Objects.equals(this.metadata, v1alpha2Challenge.metadata) - && Objects.equals(this.spec, v1alpha2Challenge.spec) - && Objects.equals(this.status, v1alpha2Challenge.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2Challenge {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java deleted file mode 100644 index e1d4cf8c3f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ChallengeList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ChallengeList is a list of Challenge */ -@ApiModel(description = "ChallengeList is a list of Challenge") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2ChallengeList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2ChallengeList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2ChallengeList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2ChallengeList addItemsItem(V1alpha2Challenge itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of challenges. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2ChallengeList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2ChallengeList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2ChallengeList v1alpha2ChallengeList = (V1alpha2ChallengeList) o; - return Objects.equals(this.apiVersion, v1alpha2ChallengeList.apiVersion) - && Objects.equals(this.items, v1alpha2ChallengeList.items) - && Objects.equals(this.kind, v1alpha2ChallengeList.kind) - && Objects.equals(this.metadata, v1alpha2ChallengeList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2ChallengeList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java deleted file mode 100644 index 01c61268ca..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuer.java +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and - * therefore can be referenced by resources that exist in *any* namespace, not just the same - * namespace as the referent. - */ -@ApiModel( - description = - "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3ClusterIssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha3ClusterIssuerStatus status; - - public V1alpha2ClusterIssuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2ClusterIssuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2ClusterIssuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2ClusterIssuer spec(V1alpha3ClusterIssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ClusterIssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3ClusterIssuerSpec spec) { - this.spec = spec; - } - - public V1alpha2ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ClusterIssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha3ClusterIssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2ClusterIssuer v1alpha2ClusterIssuer = (V1alpha2ClusterIssuer) o; - return Objects.equals(this.apiVersion, v1alpha2ClusterIssuer.apiVersion) - && Objects.equals(this.kind, v1alpha2ClusterIssuer.kind) - && Objects.equals(this.metadata, v1alpha2ClusterIssuer.metadata) - && Objects.equals(this.spec, v1alpha2ClusterIssuer.spec) - && Objects.equals(this.status, v1alpha2ClusterIssuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2ClusterIssuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java deleted file mode 100644 index 1d801fecb4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2ClusterIssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ClusterIssuerList is a list of ClusterIssuer */ -@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2ClusterIssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2ClusterIssuerList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2ClusterIssuerList addItemsItem(V1alpha2ClusterIssuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of clusterissuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2ClusterIssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2ClusterIssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2ClusterIssuerList v1alpha2ClusterIssuerList = (V1alpha2ClusterIssuerList) o; - return Objects.equals(this.apiVersion, v1alpha2ClusterIssuerList.apiVersion) - && Objects.equals(this.items, v1alpha2ClusterIssuerList.items) - && Objects.equals(this.kind, v1alpha2ClusterIssuerList.kind) - && Objects.equals(this.metadata, v1alpha2ClusterIssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2ClusterIssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java deleted file mode 100644 index bc7673971d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Issuer.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * An Issuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is scoped to a single namespace and can therefore only be - * referenced by resources within the same namespace. - */ -@ApiModel( - description = - "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2Issuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2IssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha2IssuerStatus status; - - public V1alpha2Issuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2Issuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2Issuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2Issuer spec(V1alpha2IssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2IssuerSpec spec) { - this.spec = spec; - } - - public V1alpha2Issuer status(V1alpha2IssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha2IssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2Issuer v1alpha2Issuer = (V1alpha2Issuer) o; - return Objects.equals(this.apiVersion, v1alpha2Issuer.apiVersion) - && Objects.equals(this.kind, v1alpha2Issuer.kind) - && Objects.equals(this.metadata, v1alpha2Issuer.metadata) - && Objects.equals(this.spec, v1alpha2Issuer.spec) - && Objects.equals(this.status, v1alpha2Issuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2Issuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java deleted file mode 100644 index 15472546e4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** IssuerList is a list of Issuer */ -@ApiModel(description = "IssuerList is a list of Issuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2IssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2IssuerList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2IssuerList addItemsItem(V1alpha2Issuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of issuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2IssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2IssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerList v1alpha2IssuerList = (V1alpha2IssuerList) o; - return Objects.equals(this.apiVersion, v1alpha2IssuerList.apiVersion) - && Objects.equals(this.items, v1alpha2IssuerList.items) - && Objects.equals(this.kind, v1alpha2IssuerList.kind) - && Objects.equals(this.metadata, v1alpha2IssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java deleted file mode 100644 index a841c044a1..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpec.java +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Desired state of the Issuer resource. */ -@ApiModel(description = "Desired state of the Issuer resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpec { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1alpha2IssuerSpecAcme acme; - - public static final String SERIALIZED_NAME_CA = "ca"; - - @SerializedName(SERIALIZED_NAME_CA) - private V1alpha2IssuerSpecCa ca; - - public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; - - @SerializedName(SERIALIZED_NAME_SELF_SIGNED) - private V1alpha2IssuerSpecSelfSigned selfSigned; - - public static final String SERIALIZED_NAME_VAULT = "vault"; - - @SerializedName(SERIALIZED_NAME_VAULT) - private V1alpha2IssuerSpecVault vault; - - public static final String SERIALIZED_NAME_VENAFI = "venafi"; - - @SerializedName(SERIALIZED_NAME_VENAFI) - private V1alpha2IssuerSpecVenafi venafi; - - public V1alpha2IssuerSpec acme(V1alpha2IssuerSpecAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcme getAcme() { - return acme; - } - - public void setAcme(V1alpha2IssuerSpecAcme acme) { - this.acme = acme; - } - - public V1alpha2IssuerSpec ca(V1alpha2IssuerSpecCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * - * @return ca - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecCa getCa() { - return ca; - } - - public void setCa(V1alpha2IssuerSpecCa ca) { - this.ca = ca; - } - - public V1alpha2IssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - - this.selfSigned = selfSigned; - return this; - } - - /** - * Get selfSigned - * - * @return selfSigned - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecSelfSigned getSelfSigned() { - return selfSigned; - } - - public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - this.selfSigned = selfSigned; - } - - public V1alpha2IssuerSpec vault(V1alpha2IssuerSpecVault vault) { - - this.vault = vault; - return this; - } - - /** - * Get vault - * - * @return vault - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVault getVault() { - return vault; - } - - public void setVault(V1alpha2IssuerSpecVault vault) { - this.vault = vault; - } - - public V1alpha2IssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { - - this.venafi = venafi; - return this; - } - - /** - * Get venafi - * - * @return venafi - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafi getVenafi() { - return venafi; - } - - public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { - this.venafi = venafi; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpec v1alpha2IssuerSpec = (V1alpha2IssuerSpec) o; - return Objects.equals(this.acme, v1alpha2IssuerSpec.acme) - && Objects.equals(this.ca, v1alpha2IssuerSpec.ca) - && Objects.equals(this.selfSigned, v1alpha2IssuerSpec.selfSigned) - && Objects.equals(this.vault, v1alpha2IssuerSpec.vault) - && Objects.equals(this.venafi, v1alpha2IssuerSpec.venafi); - } - - @Override - public int hashCode() { - return Objects.hash(acme, ca, selfSigned, vault, venafi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpec {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); - sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); - sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java deleted file mode 100644 index 507f3125b3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcme.java +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 - * certificates. - */ -@ApiModel( - description = - "ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 certificates.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcme { - public static final String SERIALIZED_NAME_EMAIL = "email"; - - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING = "externalAccountBinding"; - - @SerializedName(SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING) - private V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding; - - public static final String SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF = "privateKeySecretRef"; - - @SerializedName(SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF) - private V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef; - - public static final String SERIALIZED_NAME_SERVER = "server"; - - @SerializedName(SERIALIZED_NAME_SERVER) - private String server; - - public static final String SERIALIZED_NAME_SKIP_T_L_S_VERIFY = "skipTLSVerify"; - - @SerializedName(SERIALIZED_NAME_SKIP_T_L_S_VERIFY) - private Boolean skipTLSVerify; - - public static final String SERIALIZED_NAME_SOLVERS = "solvers"; - - @SerializedName(SERIALIZED_NAME_SOLVERS) - private List solvers = null; - - public V1alpha2IssuerSpecAcme email(String email) { - - this.email = email; - return this; - } - - /** - * Email is the email address to be associated with the ACME account. This field is optional, but - * it is strongly recommended to be set. It will be used to contact you in case of issues with - * your account or certificates, including expiry notification emails. This field may be updated - * after the account is initially registered. - * - * @return email - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Email is the email address to be associated with the ACME account. This field is optional, but it is strongly recommended to be set. It will be used to contact you in case of issues with your account or certificates, including expiry notification emails. This field may be updated after the account is initially registered.") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public V1alpha2IssuerSpecAcme externalAccountBinding( - V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { - - this.externalAccountBinding = externalAccountBinding; - return this; - } - - /** - * Get externalAccountBinding - * - * @return externalAccountBinding - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeExternalAccountBinding getExternalAccountBinding() { - return externalAccountBinding; - } - - public void setExternalAccountBinding( - V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { - this.externalAccountBinding = externalAccountBinding; - } - - public V1alpha2IssuerSpecAcme privateKeySecretRef( - V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { - - this.privateKeySecretRef = privateKeySecretRef; - return this; - } - - /** - * Get privateKeySecretRef - * - * @return privateKeySecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmePrivateKeySecretRef getPrivateKeySecretRef() { - return privateKeySecretRef; - } - - public void setPrivateKeySecretRef( - V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { - this.privateKeySecretRef = privateKeySecretRef; - } - - public V1alpha2IssuerSpecAcme server(String server) { - - this.server = server; - return this; - } - - /** - * Server is the URL used to access the ACME server's 'directory' endpoint. For - * example, for Let's Encrypt's staging endpoint, you would use: - * \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints - * (i.e. RFC 8555) are supported. - * - * @return server - */ - @ApiModelProperty( - required = true, - value = - "Server is the URL used to access the ACME server's 'directory' endpoint. For example, for Let's Encrypt's staging endpoint, you would use: \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints (i.e. RFC 8555) are supported.") - public String getServer() { - return server; - } - - public void setServer(String server) { - this.server = server; - } - - public V1alpha2IssuerSpecAcme skipTLSVerify(Boolean skipTLSVerify) { - - this.skipTLSVerify = skipTLSVerify; - return this; - } - - /** - * Enables or disables validation of the ACME server TLS certificate. If true, requests to the - * ACME server will not have their TLS certificate validated (i.e. insecure connections will be - * allowed). Only enable this option in development environments. The cert-manager system - * installed roots will be used to verify connections to the ACME server if this is false. - * Defaults to false. - * - * @return skipTLSVerify - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enables or disables validation of the ACME server TLS certificate. If true, requests to the ACME server will not have their TLS certificate validated (i.e. insecure connections will be allowed). Only enable this option in development environments. The cert-manager system installed roots will be used to verify connections to the ACME server if this is false. Defaults to false.") - public Boolean getSkipTLSVerify() { - return skipTLSVerify; - } - - public void setSkipTLSVerify(Boolean skipTLSVerify) { - this.skipTLSVerify = skipTLSVerify; - } - - public V1alpha2IssuerSpecAcme solvers(List solvers) { - - this.solvers = solvers; - return this; - } - - public V1alpha2IssuerSpecAcme addSolversItem(V1alpha2IssuerSpecAcmeSolvers solversItem) { - if (this.solvers == null) { - this.solvers = new ArrayList(); - } - this.solvers.add(solversItem); - return this; - } - - /** - * Solvers is a list of challenge solvers that will be used to solve ACME challenges for the - * matching domains. Solver configurations must be provided in order to obtain certificates from - * an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/ - * - * @return solvers - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Solvers is a list of challenge solvers that will be used to solve ACME challenges for the matching domains. Solver configurations must be provided in order to obtain certificates from an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/") - public List getSolvers() { - return solvers; - } - - public void setSolvers(List solvers) { - this.solvers = solvers; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcme v1alpha2IssuerSpecAcme = (V1alpha2IssuerSpecAcme) o; - return Objects.equals(this.email, v1alpha2IssuerSpecAcme.email) - && Objects.equals( - this.externalAccountBinding, v1alpha2IssuerSpecAcme.externalAccountBinding) - && Objects.equals(this.privateKeySecretRef, v1alpha2IssuerSpecAcme.privateKeySecretRef) - && Objects.equals(this.server, v1alpha2IssuerSpecAcme.server) - && Objects.equals(this.skipTLSVerify, v1alpha2IssuerSpecAcme.skipTLSVerify) - && Objects.equals(this.solvers, v1alpha2IssuerSpecAcme.solvers); - } - - @Override - public int hashCode() { - return Objects.hash( - email, externalAccountBinding, privateKeySecretRef, server, skipTLSVerify, solvers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcme {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" externalAccountBinding: ") - .append(toIndentedString(externalAccountBinding)) - .append("\n"); - sb.append(" privateKeySecretRef: ") - .append(toIndentedString(privateKeySecretRef)) - .append("\n"); - sb.append(" server: ").append(toIndentedString(server)).append("\n"); - sb.append(" skipTLSVerify: ").append(toIndentedString(skipTLSVerify)).append("\n"); - sb.append(" solvers: ").append(toIndentedString(solvers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java deleted file mode 100644 index 52f2b05156..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01.java +++ /dev/null @@ -1,412 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** - * Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge - * flow. - */ -@ApiModel( - description = - "Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge flow.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01 { - public static final String SERIALIZED_NAME_ACMEDNS = "acmedns"; - - @SerializedName(SERIALIZED_NAME_ACMEDNS) - private V1alpha2IssuerSpecAcmeDns01Acmedns acmedns; - - public static final String SERIALIZED_NAME_AKAMAI = "akamai"; - - @SerializedName(SERIALIZED_NAME_AKAMAI) - private V1alpha2IssuerSpecAcmeDns01Akamai akamai; - - public static final String SERIALIZED_NAME_AZUREDNS = "azuredns"; - - @SerializedName(SERIALIZED_NAME_AZUREDNS) - private V1alpha2IssuerSpecAcmeDns01Azuredns azuredns; - - public static final String SERIALIZED_NAME_CLOUDDNS = "clouddns"; - - @SerializedName(SERIALIZED_NAME_CLOUDDNS) - private V1alpha2IssuerSpecAcmeDns01Clouddns clouddns; - - public static final String SERIALIZED_NAME_CLOUDFLARE = "cloudflare"; - - @SerializedName(SERIALIZED_NAME_CLOUDFLARE) - private V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare; - - /** - * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS - * zones. - */ - @JsonAdapter(CnameStrategyEnum.Adapter.class) - public enum CnameStrategyEnum { - NONE("None"), - - FOLLOW("Follow"); - - private String value; - - CnameStrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CnameStrategyEnum fromValue(String value) { - for (CnameStrategyEnum b : CnameStrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CnameStrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CnameStrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CnameStrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_CNAME_STRATEGY = "cnameStrategy"; - - @SerializedName(SERIALIZED_NAME_CNAME_STRATEGY) - private CnameStrategyEnum cnameStrategy; - - public static final String SERIALIZED_NAME_DIGITALOCEAN = "digitalocean"; - - @SerializedName(SERIALIZED_NAME_DIGITALOCEAN) - private V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean; - - public static final String SERIALIZED_NAME_RFC2136 = "rfc2136"; - - @SerializedName(SERIALIZED_NAME_RFC2136) - private V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136; - - public static final String SERIALIZED_NAME_ROUTE53 = "route53"; - - @SerializedName(SERIALIZED_NAME_ROUTE53) - private V1alpha2IssuerSpecAcmeDns01Route53 route53; - - public static final String SERIALIZED_NAME_WEBHOOK = "webhook"; - - @SerializedName(SERIALIZED_NAME_WEBHOOK) - private V1alpha2IssuerSpecAcmeDns01Webhook webhook; - - public V1alpha2IssuerSpecAcmeDns01 acmedns(V1alpha2IssuerSpecAcmeDns01Acmedns acmedns) { - - this.acmedns = acmedns; - return this; - } - - /** - * Get acmedns - * - * @return acmedns - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Acmedns getAcmedns() { - return acmedns; - } - - public void setAcmedns(V1alpha2IssuerSpecAcmeDns01Acmedns acmedns) { - this.acmedns = acmedns; - } - - public V1alpha2IssuerSpecAcmeDns01 akamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { - - this.akamai = akamai; - return this; - } - - /** - * Get akamai - * - * @return akamai - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Akamai getAkamai() { - return akamai; - } - - public void setAkamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { - this.akamai = akamai; - } - - public V1alpha2IssuerSpecAcmeDns01 azuredns(V1alpha2IssuerSpecAcmeDns01Azuredns azuredns) { - - this.azuredns = azuredns; - return this; - } - - /** - * Get azuredns - * - * @return azuredns - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Azuredns getAzuredns() { - return azuredns; - } - - public void setAzuredns(V1alpha2IssuerSpecAcmeDns01Azuredns azuredns) { - this.azuredns = azuredns; - } - - public V1alpha2IssuerSpecAcmeDns01 clouddns(V1alpha2IssuerSpecAcmeDns01Clouddns clouddns) { - - this.clouddns = clouddns; - return this; - } - - /** - * Get clouddns - * - * @return clouddns - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Clouddns getClouddns() { - return clouddns; - } - - public void setClouddns(V1alpha2IssuerSpecAcmeDns01Clouddns clouddns) { - this.clouddns = clouddns; - } - - public V1alpha2IssuerSpecAcmeDns01 cloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { - - this.cloudflare = cloudflare; - return this; - } - - /** - * Get cloudflare - * - * @return cloudflare - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Cloudflare getCloudflare() { - return cloudflare; - } - - public void setCloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { - this.cloudflare = cloudflare; - } - - public V1alpha2IssuerSpecAcmeDns01 cnameStrategy(CnameStrategyEnum cnameStrategy) { - - this.cnameStrategy = cnameStrategy; - return this; - } - - /** - * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS - * zones. - * - * @return cnameStrategy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS zones.") - public CnameStrategyEnum getCnameStrategy() { - return cnameStrategy; - } - - public void setCnameStrategy(CnameStrategyEnum cnameStrategy) { - this.cnameStrategy = cnameStrategy; - } - - public V1alpha2IssuerSpecAcmeDns01 digitalocean( - V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { - - this.digitalocean = digitalocean; - return this; - } - - /** - * Get digitalocean - * - * @return digitalocean - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Digitalocean getDigitalocean() { - return digitalocean; - } - - public void setDigitalocean(V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { - this.digitalocean = digitalocean; - } - - public V1alpha2IssuerSpecAcmeDns01 rfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { - - this.rfc2136 = rfc2136; - return this; - } - - /** - * Get rfc2136 - * - * @return rfc2136 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Rfc2136 getRfc2136() { - return rfc2136; - } - - public void setRfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { - this.rfc2136 = rfc2136; - } - - public V1alpha2IssuerSpecAcmeDns01 route53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { - - this.route53 = route53; - return this; - } - - /** - * Get route53 - * - * @return route53 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Route53 getRoute53() { - return route53; - } - - public void setRoute53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { - this.route53 = route53; - } - - public V1alpha2IssuerSpecAcmeDns01 webhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { - - this.webhook = webhook; - return this; - } - - /** - * Get webhook - * - * @return webhook - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Webhook getWebhook() { - return webhook; - } - - public void setWebhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { - this.webhook = webhook; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01 v1alpha2IssuerSpecAcmeDns01 = (V1alpha2IssuerSpecAcmeDns01) o; - return Objects.equals(this.acmedns, v1alpha2IssuerSpecAcmeDns01.acmedns) - && Objects.equals(this.akamai, v1alpha2IssuerSpecAcmeDns01.akamai) - && Objects.equals(this.azuredns, v1alpha2IssuerSpecAcmeDns01.azuredns) - && Objects.equals(this.clouddns, v1alpha2IssuerSpecAcmeDns01.clouddns) - && Objects.equals(this.cloudflare, v1alpha2IssuerSpecAcmeDns01.cloudflare) - && Objects.equals(this.cnameStrategy, v1alpha2IssuerSpecAcmeDns01.cnameStrategy) - && Objects.equals(this.digitalocean, v1alpha2IssuerSpecAcmeDns01.digitalocean) - && Objects.equals(this.rfc2136, v1alpha2IssuerSpecAcmeDns01.rfc2136) - && Objects.equals(this.route53, v1alpha2IssuerSpecAcmeDns01.route53) - && Objects.equals(this.webhook, v1alpha2IssuerSpecAcmeDns01.webhook); - } - - @Override - public int hashCode() { - return Objects.hash( - acmedns, - akamai, - azuredns, - clouddns, - cloudflare, - cnameStrategy, - digitalocean, - rfc2136, - route53, - webhook); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01 {\n"); - sb.append(" acmedns: ").append(toIndentedString(acmedns)).append("\n"); - sb.append(" akamai: ").append(toIndentedString(akamai)).append("\n"); - sb.append(" azuredns: ").append(toIndentedString(azuredns)).append("\n"); - sb.append(" clouddns: ").append(toIndentedString(clouddns)).append("\n"); - sb.append(" cloudflare: ").append(toIndentedString(cloudflare)).append("\n"); - sb.append(" cnameStrategy: ").append(toIndentedString(cnameStrategy)).append("\n"); - sb.append(" digitalocean: ").append(toIndentedString(digitalocean)).append("\n"); - sb.append(" rfc2136: ").append(toIndentedString(rfc2136)).append("\n"); - sb.append(" route53: ").append(toIndentedString(route53)).append("\n"); - sb.append(" webhook: ").append(toIndentedString(webhook)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java deleted file mode 100644 index 4eef9e4cf4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Acmedns.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage DNS01 challenge - * records. - */ -@ApiModel( - description = - "Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Acmedns { - public static final String SERIALIZED_NAME_ACCOUNT_SECRET_REF = "accountSecretRef"; - - @SerializedName(SERIALIZED_NAME_ACCOUNT_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef; - - public static final String SERIALIZED_NAME_HOST = "host"; - - @SerializedName(SERIALIZED_NAME_HOST) - private String host; - - public V1alpha2IssuerSpecAcmeDns01Acmedns accountSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef) { - - this.accountSecretRef = accountSecretRef; - return this; - } - - /** - * Get accountSecretRef - * - * @return accountSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getAccountSecretRef() { - return accountSecretRef; - } - - public void setAccountSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accountSecretRef) { - this.accountSecretRef = accountSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Acmedns host(String host) { - - this.host = host; - return this; - } - - /** - * Get host - * - * @return host - */ - @ApiModelProperty(required = true, value = "") - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Acmedns v1alpha2IssuerSpecAcmeDns01Acmedns = - (V1alpha2IssuerSpecAcmeDns01Acmedns) o; - return Objects.equals( - this.accountSecretRef, v1alpha2IssuerSpecAcmeDns01Acmedns.accountSecretRef) - && Objects.equals(this.host, v1alpha2IssuerSpecAcmeDns01Acmedns.host); - } - - @Override - public int hashCode() { - return Objects.hash(accountSecretRef, host); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Acmedns {\n"); - sb.append(" accountSecretRef: ").append(toIndentedString(accountSecretRef)).append("\n"); - sb.append(" host: ").append(toIndentedString(host)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java deleted file mode 100644 index 40f83f8ccb..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A reference to a specific 'key' within a Secret resource. In some instances, - * `key` is a required field. - */ -@ApiModel( - description = - "A reference to a specific 'key' within a Secret resource. In some instances, `key` is a required field.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef - v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef = - (V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java deleted file mode 100644 index 3ea5317708..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Akamai.java +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Use the Akamai DNS zone management API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the Akamai DNS zone management API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Akamai { - public static final String SERIALIZED_NAME_ACCESS_TOKEN_SECRET_REF = "accessTokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef; - - public static final String SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF = "clientSecretSecretRef"; - - @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef; - - public static final String SERIALIZED_NAME_CLIENT_TOKEN_SECRET_REF = "clientTokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_CLIENT_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef; - - public static final String SERIALIZED_NAME_SERVICE_CONSUMER_DOMAIN = "serviceConsumerDomain"; - - @SerializedName(SERIALIZED_NAME_SERVICE_CONSUMER_DOMAIN) - private String serviceConsumerDomain; - - public V1alpha2IssuerSpecAcmeDns01Akamai accessTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef) { - - this.accessTokenSecretRef = accessTokenSecretRef; - return this; - } - - /** - * Get accessTokenSecretRef - * - * @return accessTokenSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getAccessTokenSecretRef() { - return accessTokenSecretRef; - } - - public void setAccessTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef accessTokenSecretRef) { - this.accessTokenSecretRef = accessTokenSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Akamai clientSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef) { - - this.clientSecretSecretRef = clientSecretSecretRef; - return this; - } - - /** - * Get clientSecretSecretRef - * - * @return clientSecretSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getClientSecretSecretRef() { - return clientSecretSecretRef; - } - - public void setClientSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientSecretSecretRef) { - this.clientSecretSecretRef = clientSecretSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Akamai clientTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef) { - - this.clientTokenSecretRef = clientTokenSecretRef; - return this; - } - - /** - * Get clientTokenSecretRef - * - * @return clientTokenSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getClientTokenSecretRef() { - return clientTokenSecretRef; - } - - public void setClientTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef clientTokenSecretRef) { - this.clientTokenSecretRef = clientTokenSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Akamai serviceConsumerDomain(String serviceConsumerDomain) { - - this.serviceConsumerDomain = serviceConsumerDomain; - return this; - } - - /** - * Get serviceConsumerDomain - * - * @return serviceConsumerDomain - */ - @ApiModelProperty(required = true, value = "") - public String getServiceConsumerDomain() { - return serviceConsumerDomain; - } - - public void setServiceConsumerDomain(String serviceConsumerDomain) { - this.serviceConsumerDomain = serviceConsumerDomain; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Akamai v1alpha2IssuerSpecAcmeDns01Akamai = - (V1alpha2IssuerSpecAcmeDns01Akamai) o; - return Objects.equals( - this.accessTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.accessTokenSecretRef) - && Objects.equals( - this.clientSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.clientSecretSecretRef) - && Objects.equals( - this.clientTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Akamai.clientTokenSecretRef) - && Objects.equals( - this.serviceConsumerDomain, v1alpha2IssuerSpecAcmeDns01Akamai.serviceConsumerDomain); - } - - @Override - public int hashCode() { - return Objects.hash( - accessTokenSecretRef, clientSecretSecretRef, clientTokenSecretRef, serviceConsumerDomain); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Akamai {\n"); - sb.append(" accessTokenSecretRef: ") - .append(toIndentedString(accessTokenSecretRef)) - .append("\n"); - sb.append(" clientSecretSecretRef: ") - .append(toIndentedString(clientSecretSecretRef)) - .append("\n"); - sb.append(" clientTokenSecretRef: ") - .append(toIndentedString(clientTokenSecretRef)) - .append("\n"); - sb.append(" serviceConsumerDomain: ") - .append(toIndentedString(serviceConsumerDomain)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java deleted file mode 100644 index f2ed189375..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Azuredns.java +++ /dev/null @@ -1,323 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** Use the Microsoft Azure DNS API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the Microsoft Azure DNS API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Azuredns { - public static final String SERIALIZED_NAME_CLIENT_I_D = "clientID"; - - @SerializedName(SERIALIZED_NAME_CLIENT_I_D) - private String clientID; - - public static final String SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF = "clientSecretSecretRef"; - - @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef; - - /** Gets or Sets environment */ - @JsonAdapter(EnvironmentEnum.Adapter.class) - public enum EnvironmentEnum { - AZUREPUBLICCLOUD("AzurePublicCloud"), - - AZURECHINACLOUD("AzureChinaCloud"), - - AZUREGERMANCLOUD("AzureGermanCloud"), - - AZUREUSGOVERNMENTCLOUD("AzureUSGovernmentCloud"); - - private String value; - - EnvironmentEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnvironmentEnum fromValue(String value) { - for (EnvironmentEnum b : EnvironmentEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentEnum environment; - - public static final String SERIALIZED_NAME_HOSTED_ZONE_NAME = "hostedZoneName"; - - @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_NAME) - private String hostedZoneName; - - public static final String SERIALIZED_NAME_RESOURCE_GROUP_NAME = "resourceGroupName"; - - @SerializedName(SERIALIZED_NAME_RESOURCE_GROUP_NAME) - private String resourceGroupName; - - public static final String SERIALIZED_NAME_SUBSCRIPTION_I_D = "subscriptionID"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_I_D) - private String subscriptionID; - - public static final String SERIALIZED_NAME_TENANT_I_D = "tenantID"; - - @SerializedName(SERIALIZED_NAME_TENANT_I_D) - private String tenantID; - - public V1alpha2IssuerSpecAcmeDns01Azuredns clientID(String clientID) { - - this.clientID = clientID; - return this; - } - - /** - * if both this and ClientSecret are left unset MSI will be used - * - * @return clientID - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "if both this and ClientSecret are left unset MSI will be used") - public String getClientID() { - return clientID; - } - - public void setClientID(String clientID) { - this.clientID = clientID; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns clientSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef) { - - this.clientSecretSecretRef = clientSecretSecretRef; - return this; - } - - /** - * Get clientSecretSecretRef - * - * @return clientSecretSecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef getClientSecretSecretRef() { - return clientSecretSecretRef; - } - - public void setClientSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef clientSecretSecretRef) { - this.clientSecretSecretRef = clientSecretSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns environment(EnvironmentEnum environment) { - - this.environment = environment; - return this; - } - - /** - * Get environment - * - * @return environment - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public EnvironmentEnum getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentEnum environment) { - this.environment = environment; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns hostedZoneName(String hostedZoneName) { - - this.hostedZoneName = hostedZoneName; - return this; - } - - /** - * Get hostedZoneName - * - * @return hostedZoneName - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getHostedZoneName() { - return hostedZoneName; - } - - public void setHostedZoneName(String hostedZoneName) { - this.hostedZoneName = hostedZoneName; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns resourceGroupName(String resourceGroupName) { - - this.resourceGroupName = resourceGroupName; - return this; - } - - /** - * Get resourceGroupName - * - * @return resourceGroupName - */ - @ApiModelProperty(required = true, value = "") - public String getResourceGroupName() { - return resourceGroupName; - } - - public void setResourceGroupName(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns subscriptionID(String subscriptionID) { - - this.subscriptionID = subscriptionID; - return this; - } - - /** - * Get subscriptionID - * - * @return subscriptionID - */ - @ApiModelProperty(required = true, value = "") - public String getSubscriptionID() { - return subscriptionID; - } - - public void setSubscriptionID(String subscriptionID) { - this.subscriptionID = subscriptionID; - } - - public V1alpha2IssuerSpecAcmeDns01Azuredns tenantID(String tenantID) { - - this.tenantID = tenantID; - return this; - } - - /** - * when specifying ClientID and ClientSecret then this field is also needed - * - * @return tenantID - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "when specifying ClientID and ClientSecret then this field is also needed") - public String getTenantID() { - return tenantID; - } - - public void setTenantID(String tenantID) { - this.tenantID = tenantID; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Azuredns v1alpha2IssuerSpecAcmeDns01Azuredns = - (V1alpha2IssuerSpecAcmeDns01Azuredns) o; - return Objects.equals(this.clientID, v1alpha2IssuerSpecAcmeDns01Azuredns.clientID) - && Objects.equals( - this.clientSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Azuredns.clientSecretSecretRef) - && Objects.equals(this.environment, v1alpha2IssuerSpecAcmeDns01Azuredns.environment) - && Objects.equals(this.hostedZoneName, v1alpha2IssuerSpecAcmeDns01Azuredns.hostedZoneName) - && Objects.equals( - this.resourceGroupName, v1alpha2IssuerSpecAcmeDns01Azuredns.resourceGroupName) - && Objects.equals(this.subscriptionID, v1alpha2IssuerSpecAcmeDns01Azuredns.subscriptionID) - && Objects.equals(this.tenantID, v1alpha2IssuerSpecAcmeDns01Azuredns.tenantID); - } - - @Override - public int hashCode() { - return Objects.hash( - clientID, - clientSecretSecretRef, - environment, - hostedZoneName, - resourceGroupName, - subscriptionID, - tenantID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Azuredns {\n"); - sb.append(" clientID: ").append(toIndentedString(clientID)).append("\n"); - sb.append(" clientSecretSecretRef: ") - .append(toIndentedString(clientSecretSecretRef)) - .append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" hostedZoneName: ").append(toIndentedString(hostedZoneName)).append("\n"); - sb.append(" resourceGroupName: ").append(toIndentedString(resourceGroupName)).append("\n"); - sb.append(" subscriptionID: ").append(toIndentedString(subscriptionID)).append("\n"); - sb.append(" tenantID: ").append(toIndentedString(tenantID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java deleted file mode 100644 index 5c3721a35f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** if both this and ClientID are left unset MSI will be used */ -@ApiModel(description = "if both this and ClientID are left unset MSI will be used") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef - v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef = - (V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01AzurednsClientSecretSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java deleted file mode 100644 index 365a615578..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Clouddns.java +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Use the Google Cloud DNS API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the Google Cloud DNS API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Clouddns { - public static final String SERIALIZED_NAME_HOSTED_ZONE_NAME = "hostedZoneName"; - - @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_NAME) - private String hostedZoneName; - - public static final String SERIALIZED_NAME_PROJECT = "project"; - - @SerializedName(SERIALIZED_NAME_PROJECT) - private String project; - - public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_SECRET_REF = "serviceAccountSecretRef"; - - @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef; - - public V1alpha2IssuerSpecAcmeDns01Clouddns hostedZoneName(String hostedZoneName) { - - this.hostedZoneName = hostedZoneName; - return this; - } - - /** - * HostedZoneName is an optional field that tells cert-manager in which Cloud DNS zone the - * challenge record has to be created. If left empty cert-manager will automatically choose a - * zone. - * - * @return hostedZoneName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "HostedZoneName is an optional field that tells cert-manager in which Cloud DNS zone the challenge record has to be created. If left empty cert-manager will automatically choose a zone.") - public String getHostedZoneName() { - return hostedZoneName; - } - - public void setHostedZoneName(String hostedZoneName) { - this.hostedZoneName = hostedZoneName; - } - - public V1alpha2IssuerSpecAcmeDns01Clouddns project(String project) { - - this.project = project; - return this; - } - - /** - * Get project - * - * @return project - */ - @ApiModelProperty(required = true, value = "") - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public V1alpha2IssuerSpecAcmeDns01Clouddns serviceAccountSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef) { - - this.serviceAccountSecretRef = serviceAccountSecretRef; - return this; - } - - /** - * Get serviceAccountSecretRef - * - * @return serviceAccountSecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getServiceAccountSecretRef() { - return serviceAccountSecretRef; - } - - public void setServiceAccountSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef serviceAccountSecretRef) { - this.serviceAccountSecretRef = serviceAccountSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Clouddns v1alpha2IssuerSpecAcmeDns01Clouddns = - (V1alpha2IssuerSpecAcmeDns01Clouddns) o; - return Objects.equals(this.hostedZoneName, v1alpha2IssuerSpecAcmeDns01Clouddns.hostedZoneName) - && Objects.equals(this.project, v1alpha2IssuerSpecAcmeDns01Clouddns.project) - && Objects.equals( - this.serviceAccountSecretRef, - v1alpha2IssuerSpecAcmeDns01Clouddns.serviceAccountSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(hostedZoneName, project, serviceAccountSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Clouddns {\n"); - sb.append(" hostedZoneName: ").append(toIndentedString(hostedZoneName)).append("\n"); - sb.append(" project: ").append(toIndentedString(project)).append("\n"); - sb.append(" serviceAccountSecretRef: ") - .append(toIndentedString(serviceAccountSecretRef)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java deleted file mode 100644 index 185112db60..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Cloudflare.java +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Use the Cloudflare API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the Cloudflare API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Cloudflare { - public static final String SERIALIZED_NAME_API_KEY_SECRET_REF = "apiKeySecretRef"; - - @SerializedName(SERIALIZED_NAME_API_KEY_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef; - - public static final String SERIALIZED_NAME_API_TOKEN_SECRET_REF = "apiTokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_API_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public V1alpha2IssuerSpecAcmeDns01Cloudflare apiKeySecretRef( - V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef) { - - this.apiKeySecretRef = apiKeySecretRef; - return this; - } - - /** - * Get apiKeySecretRef - * - * @return apiKeySecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef getApiKeySecretRef() { - return apiKeySecretRef; - } - - public void setApiKeySecretRef( - V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef apiKeySecretRef) { - this.apiKeySecretRef = apiKeySecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Cloudflare apiTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef) { - - this.apiTokenSecretRef = apiTokenSecretRef; - return this; - } - - /** - * Get apiTokenSecretRef - * - * @return apiTokenSecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef getApiTokenSecretRef() { - return apiTokenSecretRef; - } - - public void setApiTokenSecretRef( - V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef apiTokenSecretRef) { - this.apiTokenSecretRef = apiTokenSecretRef; - } - - public V1alpha2IssuerSpecAcmeDns01Cloudflare email(String email) { - - this.email = email; - return this; - } - - /** - * Email of the account, only required when using API key based authentication. - * - * @return email - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Email of the account, only required when using API key based authentication.") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Cloudflare v1alpha2IssuerSpecAcmeDns01Cloudflare = - (V1alpha2IssuerSpecAcmeDns01Cloudflare) o; - return Objects.equals( - this.apiKeySecretRef, v1alpha2IssuerSpecAcmeDns01Cloudflare.apiKeySecretRef) - && Objects.equals( - this.apiTokenSecretRef, v1alpha2IssuerSpecAcmeDns01Cloudflare.apiTokenSecretRef) - && Objects.equals(this.email, v1alpha2IssuerSpecAcmeDns01Cloudflare.email); - } - - @Override - public int hashCode() { - return Objects.hash(apiKeySecretRef, apiTokenSecretRef, email); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Cloudflare {\n"); - sb.append(" apiKeySecretRef: ").append(toIndentedString(apiKeySecretRef)).append("\n"); - sb.append(" apiTokenSecretRef: ").append(toIndentedString(apiTokenSecretRef)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java deleted file mode 100644 index daf484c328..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * API key to use to authenticate with Cloudflare. Note: using an API token to authenticate is now - * the recommended method as it allows greater control of permissions. - */ -@ApiModel( - description = - "API key to use to authenticate with Cloudflare. Note: using an API token to authenticate is now the recommended method as it allows greater control of permissions.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef - v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef = - (V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01CloudflareApiKeySecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java deleted file mode 100644 index cbb2792884..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** API token used to authenticate with Cloudflare. */ -@ApiModel(description = "API token used to authenticate with Cloudflare.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef - v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef = - (V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01CloudflareApiTokenSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java deleted file mode 100644 index e374eab6d8..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Digitalocean.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Use the DigitalOcean DNS API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the DigitalOcean DNS API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Digitalocean { - public static final String SERIALIZED_NAME_TOKEN_SECRET_REF = "tokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef; - - public V1alpha2IssuerSpecAcmeDns01Digitalocean tokenSecretRef( - V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef) { - - this.tokenSecretRef = tokenSecretRef; - return this; - } - - /** - * Get tokenSecretRef - * - * @return tokenSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef getTokenSecretRef() { - return tokenSecretRef; - } - - public void setTokenSecretRef(V1alpha2IssuerSpecAcmeDns01AcmednsAccountSecretRef tokenSecretRef) { - this.tokenSecretRef = tokenSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Digitalocean v1alpha2IssuerSpecAcmeDns01Digitalocean = - (V1alpha2IssuerSpecAcmeDns01Digitalocean) o; - return Objects.equals( - this.tokenSecretRef, v1alpha2IssuerSpecAcmeDns01Digitalocean.tokenSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(tokenSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Digitalocean {\n"); - sb.append(" tokenSecretRef: ").append(toIndentedString(tokenSecretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java deleted file mode 100644 index 32e6f8da03..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136.java +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Use RFC2136 (\"Dynamic Updates in the Domain Name System\") - * (https://datatracker.ietf.org/doc/rfc2136/) to manage DNS01 challenge records. - */ -@ApiModel( - description = - "Use RFC2136 (\"Dynamic Updates in the Domain Name System\") (https://datatracker.ietf.org/doc/rfc2136/) to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Rfc2136 { - public static final String SERIALIZED_NAME_NAMESERVER = "nameserver"; - - @SerializedName(SERIALIZED_NAME_NAMESERVER) - private String nameserver; - - public static final String SERIALIZED_NAME_TSIG_ALGORITHM = "tsigAlgorithm"; - - @SerializedName(SERIALIZED_NAME_TSIG_ALGORITHM) - private String tsigAlgorithm; - - public static final String SERIALIZED_NAME_TSIG_KEY_NAME = "tsigKeyName"; - - @SerializedName(SERIALIZED_NAME_TSIG_KEY_NAME) - private String tsigKeyName; - - public static final String SERIALIZED_NAME_TSIG_SECRET_SECRET_REF = "tsigSecretSecretRef"; - - @SerializedName(SERIALIZED_NAME_TSIG_SECRET_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef; - - public V1alpha2IssuerSpecAcmeDns01Rfc2136 nameserver(String nameserver) { - - this.nameserver = nameserver; - return this; - } - - /** - * The IP address or hostname of an authoritative DNS server supporting RFC2136 in the form - * host:port. If the host is an IPv6 address it must be enclosed in square brackets (e.g - * [2001:db8::1]) ; port is optional. This field is required. - * - * @return nameserver - */ - @ApiModelProperty( - required = true, - value = - "The IP address or hostname of an authoritative DNS server supporting RFC2136 in the form host:port. If the host is an IPv6 address it must be enclosed in square brackets (e.g [2001:db8::1]) ; port is optional. This field is required.") - public String getNameserver() { - return nameserver; - } - - public void setNameserver(String nameserver) { - this.nameserver = nameserver; - } - - public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigAlgorithm(String tsigAlgorithm) { - - this.tsigAlgorithm = tsigAlgorithm; - return this; - } - - /** - * The TSIG Algorithm configured in the DNS supporting RFC2136. Used only when - * ``tsigSecretSecretRef`` and ``tsigKeyName`` are - * defined. Supported values are (case-insensitive): ``HMACMD5`` (default), - * ``HMACSHA1``, ``HMACSHA256`` or - * ``HMACSHA512``. - * - * @return tsigAlgorithm - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The TSIG Algorithm configured in the DNS supporting RFC2136. Used only when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. Supported values are (case-insensitive): ``HMACMD5`` (default), ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``.") - public String getTsigAlgorithm() { - return tsigAlgorithm; - } - - public void setTsigAlgorithm(String tsigAlgorithm) { - this.tsigAlgorithm = tsigAlgorithm; - } - - public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigKeyName(String tsigKeyName) { - - this.tsigKeyName = tsigKeyName; - return this; - } - - /** - * The TSIG Key name configured in the DNS. If ``tsigSecretSecretRef`` is - * defined, this field is required. - * - * @return tsigKeyName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The TSIG Key name configured in the DNS. If ``tsigSecretSecretRef`` is defined, this field is required.") - public String getTsigKeyName() { - return tsigKeyName; - } - - public void setTsigKeyName(String tsigKeyName) { - this.tsigKeyName = tsigKeyName; - } - - public V1alpha2IssuerSpecAcmeDns01Rfc2136 tsigSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef) { - - this.tsigSecretSecretRef = tsigSecretSecretRef; - return this; - } - - /** - * Get tsigSecretSecretRef - * - * @return tsigSecretSecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef getTsigSecretSecretRef() { - return tsigSecretSecretRef; - } - - public void setTsigSecretSecretRef( - V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef tsigSecretSecretRef) { - this.tsigSecretSecretRef = tsigSecretSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Rfc2136 v1alpha2IssuerSpecAcmeDns01Rfc2136 = - (V1alpha2IssuerSpecAcmeDns01Rfc2136) o; - return Objects.equals(this.nameserver, v1alpha2IssuerSpecAcmeDns01Rfc2136.nameserver) - && Objects.equals(this.tsigAlgorithm, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigAlgorithm) - && Objects.equals(this.tsigKeyName, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigKeyName) - && Objects.equals( - this.tsigSecretSecretRef, v1alpha2IssuerSpecAcmeDns01Rfc2136.tsigSecretSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(nameserver, tsigAlgorithm, tsigKeyName, tsigSecretSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Rfc2136 {\n"); - sb.append(" nameserver: ").append(toIndentedString(nameserver)).append("\n"); - sb.append(" tsigAlgorithm: ").append(toIndentedString(tsigAlgorithm)).append("\n"); - sb.append(" tsigKeyName: ").append(toIndentedString(tsigKeyName)).append("\n"); - sb.append(" tsigSecretSecretRef: ") - .append(toIndentedString(tsigSecretSecretRef)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java deleted file mode 100644 index 2d0cd90e4a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The name of the secret containing the TSIG value. If ``tsigKeyName`` is - * defined, this field is required. - */ -@ApiModel( - description = - "The name of the secret containing the TSIG value. If ``tsigKeyName`` is defined, this field is required.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef - v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef = - (V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Rfc2136TsigSecretSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java deleted file mode 100644 index b10072bc8d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53.java +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Use the AWS Route53 API to manage DNS01 challenge records. */ -@ApiModel(description = "Use the AWS Route53 API to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Route53 { - public static final String SERIALIZED_NAME_ACCESS_KEY_I_D = "accessKeyID"; - - @SerializedName(SERIALIZED_NAME_ACCESS_KEY_I_D) - private String accessKeyID; - - public static final String SERIALIZED_NAME_HOSTED_ZONE_I_D = "hostedZoneID"; - - @SerializedName(SERIALIZED_NAME_HOSTED_ZONE_I_D) - private String hostedZoneID; - - public static final String SERIALIZED_NAME_REGION = "region"; - - @SerializedName(SERIALIZED_NAME_REGION) - private String region; - - public static final String SERIALIZED_NAME_ROLE = "role"; - - @SerializedName(SERIALIZED_NAME_ROLE) - private String role; - - public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY_SECRET_REF = - "secretAccessKeySecretRef"; - - @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY_SECRET_REF) - private V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef; - - public V1alpha2IssuerSpecAcmeDns01Route53 accessKeyID(String accessKeyID) { - - this.accessKeyID = accessKeyID; - return this; - } - - /** - * The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared - * credentials file or AWS Instance metadata see: - * https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - * - * @return accessKeyID - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials") - public String getAccessKeyID() { - return accessKeyID; - } - - public void setAccessKeyID(String accessKeyID) { - this.accessKeyID = accessKeyID; - } - - public V1alpha2IssuerSpecAcmeDns01Route53 hostedZoneID(String hostedZoneID) { - - this.hostedZoneID = hostedZoneID; - return this; - } - - /** - * If set, the provider will manage only this zone in Route53 and will not do an lookup using the - * route53:ListHostedZonesByName api call. - * - * @return hostedZoneID - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call.") - public String getHostedZoneID() { - return hostedZoneID; - } - - public void setHostedZoneID(String hostedZoneID) { - this.hostedZoneID = hostedZoneID; - } - - public V1alpha2IssuerSpecAcmeDns01Route53 region(String region) { - - this.region = region; - return this; - } - - /** - * Always set the region when using AccessKeyID and SecretAccessKey - * - * @return region - */ - @ApiModelProperty( - required = true, - value = "Always set the region when using AccessKeyID and SecretAccessKey") - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public V1alpha2IssuerSpecAcmeDns01Route53 role(String role) { - - this.role = role; - return this; - } - - /** - * Role is a Role ARN which the Route53 provider will assume using either the explicit credentials - * AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared - * credentials file or AWS Instance metadata - * - * @return role - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata") - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public V1alpha2IssuerSpecAcmeDns01Route53 secretAccessKeySecretRef( - V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef) { - - this.secretAccessKeySecretRef = secretAccessKeySecretRef; - return this; - } - - /** - * Get secretAccessKeySecretRef - * - * @return secretAccessKeySecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef getSecretAccessKeySecretRef() { - return secretAccessKeySecretRef; - } - - public void setSecretAccessKeySecretRef( - V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef secretAccessKeySecretRef) { - this.secretAccessKeySecretRef = secretAccessKeySecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Route53 v1alpha2IssuerSpecAcmeDns01Route53 = - (V1alpha2IssuerSpecAcmeDns01Route53) o; - return Objects.equals(this.accessKeyID, v1alpha2IssuerSpecAcmeDns01Route53.accessKeyID) - && Objects.equals(this.hostedZoneID, v1alpha2IssuerSpecAcmeDns01Route53.hostedZoneID) - && Objects.equals(this.region, v1alpha2IssuerSpecAcmeDns01Route53.region) - && Objects.equals(this.role, v1alpha2IssuerSpecAcmeDns01Route53.role) - && Objects.equals( - this.secretAccessKeySecretRef, - v1alpha2IssuerSpecAcmeDns01Route53.secretAccessKeySecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(accessKeyID, hostedZoneID, region, role, secretAccessKeySecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Route53 {\n"); - sb.append(" accessKeyID: ").append(toIndentedString(accessKeyID)).append("\n"); - sb.append(" hostedZoneID: ").append(toIndentedString(hostedZoneID)).append("\n"); - sb.append(" region: ").append(toIndentedString(region)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" secretAccessKeySecretRef: ") - .append(toIndentedString(secretAccessKeySecretRef)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java deleted file mode 100644 index a9772bfd65..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared - * credentials file or AWS Instance metadata - * https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - */ -@ApiModel( - description = - "The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef - v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef = - (V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.key) - && Objects.equals( - this.name, v1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Route53SecretAccessKeySecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java deleted file mode 100644 index 8ac121477b..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeDns01Webhook.java +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Configure an external webhook based DNS01 challenge solver to manage DNS01 challenge records. */ -@ApiModel( - description = - "Configure an external webhook based DNS01 challenge solver to manage DNS01 challenge records.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeDns01Webhook { - public static final String SERIALIZED_NAME_CONFIG = "config"; - - @SerializedName(SERIALIZED_NAME_CONFIG) - private Object config; - - public static final String SERIALIZED_NAME_GROUP_NAME = "groupName"; - - @SerializedName(SERIALIZED_NAME_GROUP_NAME) - private String groupName; - - public static final String SERIALIZED_NAME_SOLVER_NAME = "solverName"; - - @SerializedName(SERIALIZED_NAME_SOLVER_NAME) - private String solverName; - - public V1alpha2IssuerSpecAcmeDns01Webhook config(Object config) { - - this.config = config; - return this; - } - - /** - * Additional configuration that should be passed to the webhook apiserver when challenges are - * processed. This can contain arbitrary JSON data. Secret values should not be specified in this - * stanza. If secret values are needed (e.g. credentials for a DNS service), you should use a - * SecretKeySelector to reference a Secret resource. For details on the schema of this field, - * consult the webhook provider implementation's documentation. - * - * @return config - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Additional configuration that should be passed to the webhook apiserver when challenges are processed. This can contain arbitrary JSON data. Secret values should not be specified in this stanza. If secret values are needed (e.g. credentials for a DNS service), you should use a SecretKeySelector to reference a Secret resource. For details on the schema of this field, consult the webhook provider implementation's documentation.") - public Object getConfig() { - return config; - } - - public void setConfig(Object config) { - this.config = config; - } - - public V1alpha2IssuerSpecAcmeDns01Webhook groupName(String groupName) { - - this.groupName = groupName; - return this; - } - - /** - * The API group name that should be used when POSTing ChallengePayload resources to the webhook - * apiserver. This should be the same as the GroupName specified in the webhook provider - * implementation. - * - * @return groupName - */ - @ApiModelProperty( - required = true, - value = - "The API group name that should be used when POSTing ChallengePayload resources to the webhook apiserver. This should be the same as the GroupName specified in the webhook provider implementation.") - public String getGroupName() { - return groupName; - } - - public void setGroupName(String groupName) { - this.groupName = groupName; - } - - public V1alpha2IssuerSpecAcmeDns01Webhook solverName(String solverName) { - - this.solverName = solverName; - return this; - } - - /** - * The name of the solver to use, as defined in the webhook provider implementation. This will - * typically be the name of the provider, e.g. 'cloudflare'. - * - * @return solverName - */ - @ApiModelProperty( - required = true, - value = - "The name of the solver to use, as defined in the webhook provider implementation. This will typically be the name of the provider, e.g. 'cloudflare'.") - public String getSolverName() { - return solverName; - } - - public void setSolverName(String solverName) { - this.solverName = solverName; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeDns01Webhook v1alpha2IssuerSpecAcmeDns01Webhook = - (V1alpha2IssuerSpecAcmeDns01Webhook) o; - return Objects.equals(this.config, v1alpha2IssuerSpecAcmeDns01Webhook.config) - && Objects.equals(this.groupName, v1alpha2IssuerSpecAcmeDns01Webhook.groupName) - && Objects.equals(this.solverName, v1alpha2IssuerSpecAcmeDns01Webhook.solverName); - } - - @Override - public int hashCode() { - return Objects.hash(config, groupName, solverName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeDns01Webhook {\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); - sb.append(" solverName: ").append(toIndentedString(solverName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java deleted file mode 100644 index c53e302e64..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBinding.java +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** - * ExternalAccountBinding is a reference to a CA external account of the ACME server. If set, upon - * registration cert-manager will attempt to associate the given external account credentials with - * the registered ACME account. - */ -@ApiModel( - description = - "ExternalAccountBinding is a reference to a CA external account of the ACME server. If set, upon registration cert-manager will attempt to associate the given external account credentials with the registered ACME account.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeExternalAccountBinding { - /** - * keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are - * \"HS256\", \"HS384\" and \"HS512\". - */ - @JsonAdapter(KeyAlgorithmEnum.Adapter.class) - public enum KeyAlgorithmEnum { - HS256("HS256"), - - HS384("HS384"), - - HS512("HS512"); - - private String value; - - KeyAlgorithmEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyAlgorithmEnum fromValue(String value) { - for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyAlgorithmEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; - - @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) - private KeyAlgorithmEnum keyAlgorithm; - - public static final String SERIALIZED_NAME_KEY_I_D = "keyID"; - - @SerializedName(SERIALIZED_NAME_KEY_I_D) - private String keyID; - - public static final String SERIALIZED_NAME_KEY_SECRET_REF = "keySecretRef"; - - @SerializedName(SERIALIZED_NAME_KEY_SECRET_REF) - private V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef; - - public V1alpha2IssuerSpecAcmeExternalAccountBinding keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - - this.keyAlgorithm = keyAlgorithm; - return this; - } - - /** - * keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are - * \"HS256\", \"HS384\" and \"HS512\". - * - * @return keyAlgorithm - */ - @ApiModelProperty( - required = true, - value = - "keyAlgorithm is the MAC key algorithm that the key is used for. Valid values are \"HS256\", \"HS384\" and \"HS512\".") - public KeyAlgorithmEnum getKeyAlgorithm() { - return keyAlgorithm; - } - - public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - this.keyAlgorithm = keyAlgorithm; - } - - public V1alpha2IssuerSpecAcmeExternalAccountBinding keyID(String keyID) { - - this.keyID = keyID; - return this; - } - - /** - * keyID is the ID of the CA key that the External Account is bound to. - * - * @return keyID - */ - @ApiModelProperty( - required = true, - value = "keyID is the ID of the CA key that the External Account is bound to.") - public String getKeyID() { - return keyID; - } - - public void setKeyID(String keyID) { - this.keyID = keyID; - } - - public V1alpha2IssuerSpecAcmeExternalAccountBinding keySecretRef( - V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef) { - - this.keySecretRef = keySecretRef; - return this; - } - - /** - * Get keySecretRef - * - * @return keySecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef getKeySecretRef() { - return keySecretRef; - } - - public void setKeySecretRef( - V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef keySecretRef) { - this.keySecretRef = keySecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeExternalAccountBinding v1alpha2IssuerSpecAcmeExternalAccountBinding = - (V1alpha2IssuerSpecAcmeExternalAccountBinding) o; - return Objects.equals( - this.keyAlgorithm, v1alpha2IssuerSpecAcmeExternalAccountBinding.keyAlgorithm) - && Objects.equals(this.keyID, v1alpha2IssuerSpecAcmeExternalAccountBinding.keyID) - && Objects.equals( - this.keySecretRef, v1alpha2IssuerSpecAcmeExternalAccountBinding.keySecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(keyAlgorithm, keyID, keySecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeExternalAccountBinding {\n"); - sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); - sb.append(" keyID: ").append(toIndentedString(keyID)).append("\n"); - sb.append(" keySecretRef: ").append(toIndentedString(keySecretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java deleted file mode 100644 index 638781e70b..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.java +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes Secret which holds - * the symmetric MAC key of the External Account Binding. The `key` is the index string - * that is paired with the key data in the Secret and should not be confused with the key data - * itself, or indeed with the External Account Binding keyID above. The secret key stored in the - * Secret **must** be un-padded, base64 URL encoded data. - */ -@ApiModel( - description = - "keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes Secret which holds the symmetric MAC key of the External Account Binding. The `key` is the index string that is paired with the key data in the Secret and should not be confused with the key data itself, or indeed with the External Account Binding keyID above. The secret key stored in the Secret **must** be un-padded, base64 URL encoded data.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef - v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef = - (V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeExternalAccountBindingKeySecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java deleted file mode 100644 index 911a0e3152..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01.java +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Configures cert-manager to attempt to complete authorizations by performing the HTTP01 challenge - * flow. It is not possible to obtain certificates for wildcard domain names (e.g. - * `*.example.com`) using the HTTP01 challenge mechanism. - */ -@ApiModel( - description = - "Configures cert-manager to attempt to complete authorizations by performing the HTTP01 challenge flow. It is not possible to obtain certificates for wildcard domain names (e.g. `*.example.com`) using the HTTP01 challenge mechanism.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01 { - public static final String SERIALIZED_NAME_INGRESS = "ingress"; - - @SerializedName(SERIALIZED_NAME_INGRESS) - private V1alpha2IssuerSpecAcmeHttp01Ingress ingress; - - public V1alpha2IssuerSpecAcmeHttp01 ingress(V1alpha2IssuerSpecAcmeHttp01Ingress ingress) { - - this.ingress = ingress; - return this; - } - - /** - * Get ingress - * - * @return ingress - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01Ingress getIngress() { - return ingress; - } - - public void setIngress(V1alpha2IssuerSpecAcmeHttp01Ingress ingress) { - this.ingress = ingress; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01 v1alpha2IssuerSpecAcmeHttp01 = (V1alpha2IssuerSpecAcmeHttp01) o; - return Objects.equals(this.ingress, v1alpha2IssuerSpecAcmeHttp01.ingress); - } - - @Override - public int hashCode() { - return Objects.hash(ingress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01 {\n"); - sb.append(" ingress: ").append(toIndentedString(ingress)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java deleted file mode 100644 index f257ea7a3a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01Ingress.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The ingress based HTTP01 challenge solver will solve challenges by creating or modifying Ingress - * resources in order to route requests for '/.well-known/acme-challenge/XYZ' to - * 'challenge solver' pods that are provisioned by cert-manager for each Challenge to be - * completed. - */ -@ApiModel( - description = - "The ingress based HTTP01 challenge solver will solve challenges by creating or modifying Ingress resources in order to route requests for '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are provisioned by cert-manager for each Challenge to be completed.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01Ingress { - public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) - private String propertyClass; - - public static final String SERIALIZED_NAME_INGRESS_TEMPLATE = "ingressTemplate"; - - @SerializedName(SERIALIZED_NAME_INGRESS_TEMPLATE) - private V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_POD_TEMPLATE = "podTemplate"; - - @SerializedName(SERIALIZED_NAME_POD_TEMPLATE) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate; - - public static final String SERIALIZED_NAME_SERVICE_TYPE = "serviceType"; - - @SerializedName(SERIALIZED_NAME_SERVICE_TYPE) - private String serviceType; - - public V1alpha2IssuerSpecAcmeHttp01Ingress propertyClass(String propertyClass) { - - this.propertyClass = propertyClass; - return this; - } - - /** - * The ingress class to use when creating Ingress resources to solve ACME challenges that use this - * challenge solver. Only one of 'class' or 'name' may be specified. - * - * @return propertyClass - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The ingress class to use when creating Ingress resources to solve ACME challenges that use this challenge solver. Only one of 'class' or 'name' may be specified.") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - public V1alpha2IssuerSpecAcmeHttp01Ingress ingressTemplate( - V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate) { - - this.ingressTemplate = ingressTemplate; - return this; - } - - /** - * Get ingressTemplate - * - * @return ingressTemplate - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate getIngressTemplate() { - return ingressTemplate; - } - - public void setIngressTemplate( - V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate ingressTemplate) { - this.ingressTemplate = ingressTemplate; - } - - public V1alpha2IssuerSpecAcmeHttp01Ingress name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the ingress resource that should have ACME challenge solving routes inserted into - * it in order to solve HTTP01 challenges. This is typically used in conjunction with ingress - * controllers like ingress-gce, which maintains a 1:1 mapping between external IPs and ingress - * resources. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of the ingress resource that should have ACME challenge solving routes inserted into it in order to solve HTTP01 challenges. This is typically used in conjunction with ingress controllers like ingress-gce, which maintains a 1:1 mapping between external IPs and ingress resources.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public V1alpha2IssuerSpecAcmeHttp01Ingress podTemplate( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate) { - - this.podTemplate = podTemplate; - return this; - } - - /** - * Get podTemplate - * - * @return podTemplate - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate getPodTemplate() { - return podTemplate; - } - - public void setPodTemplate(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate podTemplate) { - this.podTemplate = podTemplate; - } - - public V1alpha2IssuerSpecAcmeHttp01Ingress serviceType(String serviceType) { - - this.serviceType = serviceType; - return this; - } - - /** - * Optional service type for Kubernetes solver service - * - * @return serviceType - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional service type for Kubernetes solver service") - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01Ingress v1alpha2IssuerSpecAcmeHttp01Ingress = - (V1alpha2IssuerSpecAcmeHttp01Ingress) o; - return Objects.equals(this.propertyClass, v1alpha2IssuerSpecAcmeHttp01Ingress.propertyClass) - && Objects.equals(this.ingressTemplate, v1alpha2IssuerSpecAcmeHttp01Ingress.ingressTemplate) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmeHttp01Ingress.name) - && Objects.equals(this.podTemplate, v1alpha2IssuerSpecAcmeHttp01Ingress.podTemplate) - && Objects.equals(this.serviceType, v1alpha2IssuerSpecAcmeHttp01Ingress.serviceType); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass, ingressTemplate, name, podTemplate, serviceType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01Ingress {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append(" ingressTemplate: ").append(toIndentedString(ingressTemplate)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" podTemplate: ").append(toIndentedString(podTemplate)).append("\n"); - sb.append(" serviceType: ").append(toIndentedString(serviceType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java deleted file mode 100644 index 08c343e348..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Optional ingress template used to configure the ACME challenge solver ingress used for HTTP01 - * challenges - */ -@ApiModel( - description = - "Optional ingress template used to configure the ACME challenge solver ingress used for HTTP01 challenges") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate { - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata; - - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate metadata( - V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata getMetadata() { - return metadata; - } - - public void setMetadata(V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate - v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate = - (V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate) o; - return Objects.equals( - this.metadata, v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplate {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java deleted file mode 100644 index b90b48c4ce..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.java +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * ObjectMeta overrides for the ingress used to solve HTTP01 challenges. Only the 'labels' - * and 'annotations' fields may be set. If labels or annotations overlap with in-built - * values, the values here will override the in-built values. - */ -@ApiModel( - description = - "ObjectMeta overrides for the ingress used to solve HTTP01 challenges. Only the 'labels' and 'annotations' fields may be set. If labels or annotations overlap with in-built values, the values here will override the in-built values.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata { - public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; - - @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = null; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata annotations( - Map annotations) { - - this.annotations = annotations; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata putAnnotationsItem( - String key, String annotationsItem) { - if (this.annotations == null) { - this.annotations = new HashMap(); - } - this.annotations.put(key, annotationsItem); - return this; - } - - /** - * Annotations that should be added to the created ACME HTTP01 solver ingress. - * - * @return annotations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Annotations that should be added to the created ACME HTTP01 solver ingress.") - public Map getAnnotations() { - return annotations; - } - - public void setAnnotations(Map annotations) { - this.annotations = annotations; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata labels( - Map labels) { - - this.labels = labels; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata putLabelsItem( - String key, String labelsItem) { - if (this.labels == null) { - this.labels = new HashMap(); - } - this.labels.put(key, labelsItem); - return this; - } - - /** - * Labels that should be added to the created ACME HTTP01 solver ingress. - * - * @return labels - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Labels that should be added to the created ACME HTTP01 solver ingress.") - public Map getLabels() { - return labels; - } - - public void setLabels(Map labels) { - this.labels = labels; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata - v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata = - (V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata) o; - return Objects.equals( - this.annotations, - v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.annotations) - && Objects.equals( - this.labels, v1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata.labels); - } - - @Override - public int hashCode() { - return Objects.hash(annotations, labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressIngressTemplateMetadata {\n"); - sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java deleted file mode 100644 index 9b2d92e209..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Optional pod template used to configure the ACME challenge solver pods used for HTTP01 challenges - */ -@ApiModel( - description = - "Optional pod template used to configure the ACME challenge solver pods used for HTTP01 challenges") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate { - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate metadata( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata getMetadata() { - return metadata; - } - - public void setMetadata(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata metadata) { - this.metadata = metadata; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate spec( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec spec) { - this.spec = spec; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate) o; - return Objects.equals(this.metadata, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.metadata) - && Objects.equals(this.spec, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplate.spec); - } - - @Override - public int hashCode() { - return Objects.hash(metadata, spec); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplate {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java deleted file mode 100644 index c22200b0ac..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * ObjectMeta overrides for the pod used to solve HTTP01 challenges. Only the 'labels' and - * 'annotations' fields may be set. If labels or annotations overlap with in-built values, - * the values here will override the in-built values. - */ -@ApiModel( - description = - "ObjectMeta overrides for the pod used to solve HTTP01 challenges. Only the 'labels' and 'annotations' fields may be set. If labels or annotations overlap with in-built values, the values here will override the in-built values.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata { - public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; - - @SerializedName(SERIALIZED_NAME_ANNOTATIONS) - private Map annotations = null; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - private Map labels = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata annotations( - Map annotations) { - - this.annotations = annotations; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata putAnnotationsItem( - String key, String annotationsItem) { - if (this.annotations == null) { - this.annotations = new HashMap(); - } - this.annotations.put(key, annotationsItem); - return this; - } - - /** - * Annotations that should be added to the create ACME HTTP01 solver pods. - * - * @return annotations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Annotations that should be added to the create ACME HTTP01 solver pods.") - public Map getAnnotations() { - return annotations; - } - - public void setAnnotations(Map annotations) { - this.annotations = annotations; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata labels(Map labels) { - - this.labels = labels; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata putLabelsItem( - String key, String labelsItem) { - if (this.labels == null) { - this.labels = new HashMap(); - } - this.labels.put(key, labelsItem); - return this; - } - - /** - * Labels that should be added to the created ACME HTTP01 solver pods. - * - * @return labels - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Labels that should be added to the created ACME HTTP01 solver pods.") - public Map getLabels() { - return labels; - } - - public void setLabels(Map labels) { - this.labels = labels; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata) o; - return Objects.equals( - this.annotations, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.annotations) - && Objects.equals( - this.labels, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata.labels); - } - - @Override - public int hashCode() { - return Objects.hash(annotations, labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateMetadata {\n"); - sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java deleted file mode 100644 index 83ca35f270..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.java +++ /dev/null @@ -1,185 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * PodSpec defines overrides for the HTTP01 challenge solver pod. Only the 'nodeSelector', - * 'affinity' and 'tolerations' fields are supported currently. All other fields - * will be ignored. - */ -@ApiModel( - description = - "PodSpec defines overrides for the HTTP01 challenge solver pod. Only the 'nodeSelector', 'affinity' and 'tolerations' fields are supported currently. All other fields will be ignored.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec { - public static final String SERIALIZED_NAME_AFFINITY = "affinity"; - - @SerializedName(SERIALIZED_NAME_AFFINITY) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity; - - public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector"; - - @SerializedName(SERIALIZED_NAME_NODE_SELECTOR) - private Map nodeSelector = null; - - public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations"; - - @SerializedName(SERIALIZED_NAME_TOLERATIONS) - private List tolerations = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec affinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity) { - - this.affinity = affinity; - return this; - } - - /** - * Get affinity - * - * @return affinity - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity getAffinity() { - return affinity; - } - - public void setAffinity(V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity affinity) { - this.affinity = affinity; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec nodeSelector( - Map nodeSelector) { - - this.nodeSelector = nodeSelector; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec putNodeSelectorItem( - String key, String nodeSelectorItem) { - if (this.nodeSelector == null) { - this.nodeSelector = new HashMap(); - } - this.nodeSelector.put(key, nodeSelectorItem); - return this; - } - - /** - * NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must - * match a node's labels for the pod to be scheduled on that node. More info: - * https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - * - * @return nodeSelector - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/") - public Map getNodeSelector() { - return nodeSelector; - } - - public void setNodeSelector(Map nodeSelector) { - this.nodeSelector = nodeSelector; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec tolerations( - List tolerations) { - - this.tolerations = tolerations; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec addTolerationsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations tolerationsItem) { - if (this.tolerations == null) { - this.tolerations = - new ArrayList(); - } - this.tolerations.add(tolerationsItem); - return this; - } - - /** - * If specified, the pod's tolerations. - * - * @return tolerations - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "If specified, the pod's tolerations.") - public List getTolerations() { - return tolerations; - } - - public void setTolerations( - List tolerations) { - this.tolerations = tolerations; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec) o; - return Objects.equals( - this.affinity, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.affinity) - && Objects.equals( - this.nodeSelector, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.nodeSelector) - && Objects.equals( - this.tolerations, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec.tolerations); - } - - @Override - public int hashCode() { - return Objects.hash(affinity, nodeSelector, tolerations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpec {\n"); - sb.append(" affinity: ").append(toIndentedString(affinity)).append("\n"); - sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n"); - sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java deleted file mode 100644 index f0725138db..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.java +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** If specified, the pod's scheduling constraints */ -@ApiModel(description = "If specified, the pod's scheduling constraints") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity { - public static final String SERIALIZED_NAME_NODE_AFFINITY = "nodeAffinity"; - - @SerializedName(SERIALIZED_NAME_NODE_AFFINITY) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity; - - public static final String SERIALIZED_NAME_POD_AFFINITY = "podAffinity"; - - @SerializedName(SERIALIZED_NAME_POD_AFFINITY) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity; - - public static final String SERIALIZED_NAME_POD_ANTI_AFFINITY = "podAntiAffinity"; - - @SerializedName(SERIALIZED_NAME_POD_ANTI_AFFINITY) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity nodeAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity) { - - this.nodeAffinity = nodeAffinity; - return this; - } - - /** - * Get nodeAffinity - * - * @return nodeAffinity - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity getNodeAffinity() { - return nodeAffinity; - } - - public void setNodeAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity nodeAffinity) { - this.nodeAffinity = nodeAffinity; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity podAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity) { - - this.podAffinity = podAffinity; - return this; - } - - /** - * Get podAffinity - * - * @return podAffinity - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity getPodAffinity() { - return podAffinity; - } - - public void setPodAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity podAffinity) { - this.podAffinity = podAffinity; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity podAntiAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity) { - - this.podAntiAffinity = podAntiAffinity; - return this; - } - - /** - * Get podAntiAffinity - * - * @return podAntiAffinity - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - getPodAntiAffinity() { - return podAntiAffinity; - } - - public void setPodAntiAffinity( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity podAntiAffinity) { - this.podAntiAffinity = podAntiAffinity; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity) o; - return Objects.equals( - this.nodeAffinity, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.nodeAffinity) - && Objects.equals( - this.podAffinity, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.podAffinity) - && Objects.equals( - this.podAntiAffinity, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity.podAntiAffinity); - } - - @Override - public int hashCode() { - return Objects.hash(nodeAffinity, podAffinity, podAntiAffinity); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinity {\n"); - sb.append(" nodeAffinity: ").append(toIndentedString(nodeAffinity)).append("\n"); - sb.append(" podAffinity: ").append(toIndentedString(podAffinity)).append("\n"); - sb.append(" podAntiAffinity: ").append(toIndentedString(podAntiAffinity)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java deleted file mode 100644 index 08e92b4a12..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity.java +++ /dev/null @@ -1,179 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Describes node affinity scheduling rules for the pod. */ -@ApiModel(description = "Describes node affinity scheduling rules for the pod.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "preferredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution = null; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "requiredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - requiredDuringSchedulingIgnoredDuringExecution; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - preferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - addPreferredDuringSchedulingIgnoredDuringExecutionItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add( - preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions - * specified by this field, but it may choose a node that violates one or more of the expressions. - * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node - * that meets all of the scheduling requirements (resource request, requiredDuringScheduling - * affinity expressions, etc.), compute a sum by iterating through the elements of this field and - * adding \"weight\" to the sum if the node matches the corresponding matchExpressions; - * the node(s) with the highest sum are the most preferred. - * - * @return preferredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> - getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - public void setPreferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - requiredDuringSchedulingIgnoredDuringExecution( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - /** - * Get requiredDuringSchedulingIgnoredDuringExecution - * - * @return requiredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - public void setRequiredDuringSchedulingIgnoredDuringExecution( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity) o; - return Objects.equals( - this.preferredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - .preferredDuringSchedulingIgnoredDuringExecution) - && Objects.equals( - this.requiredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity - .requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash( - preferredDuringSchedulingIgnoredDuringExecution, - requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java deleted file mode 100644 index 2daf27601f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference.java +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** A node selector term, associated with the corresponding weight. */ -@ApiModel(description = "A node selector term, associated with the corresponding weight.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions = null; - - public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; - - @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - matchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - addMatchExpressionsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * A list of node selector requirements by node's labels. - * - * @return matchExpressions - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of node selector requirements by node's labels.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - getMatchExpressions() { - return matchExpressions; - } - - public void setMatchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions) { - this.matchExpressions = matchExpressions; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - matchFields( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields) { - - this.matchFields = matchFields; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - addMatchFieldsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - matchFieldsItem) { - if (this.matchFields == null) { - this.matchFields = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); - } - this.matchFields.add(matchFieldsItem); - return this; - } - - /** - * A list of node selector requirements by node's fields. - * - * @return matchFields - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of node selector requirements by node's fields.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - getMatchFields() { - return matchFields; - } - - public void setMatchFields( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields) { - this.matchFields = matchFields; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference) o; - return Objects.equals( - this.matchExpressions, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - .matchExpressions) - && Objects.equals( - this.matchFields, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - .matchFields); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchFields: ").append(toIndentedString(matchFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java deleted file mode 100644 index 94856bdb8f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions.java +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * A node selector requirement is a selector that contains values, a key, and an operator that - * relates the key and values. - */ -@ApiModel( - description = - "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_VALUES = "values"; - - @SerializedName(SERIALIZED_NAME_VALUES) - private List values = null; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - key(String key) { - - this.key = key; - return this; - } - - /** - * The label key that the selector applies to. - * - * @return key - */ - @ApiModelProperty(required = true, value = "The label key that the selector applies to.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, - * DoesNotExist. Gt, and Lt. - * - * @return operator - */ - @ApiModelProperty( - required = true, - value = - "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.") - public String getOperator() { - return operator; - } - - public void setOperator(String operator) { - this.operator = operator; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - values(List values) { - - this.values = values; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(valuesItem); - return this; - } - - /** - * An array of string values. If the operator is In or NotIn, the values array must be non-empty. - * If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is - * Gt or Lt, the values array must have a single element, which will be interpreted as an integer. - * This array is replaced during a strategic merge patch. - * - * @return values - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.") - public List getValues() { - return values; - } - - public void setValues(List values) { - this.values = values; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions) - o; - return Objects.equals( - this.key, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - .key) - && Objects.equals( - this.operator, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - .operator) - && Objects.equals( - this.values, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - .values); - } - - @Override - public int hashCode() { - return Objects.hash(key, operator, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java deleted file mode 100644 index d37c79a125..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution.java +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a - * no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - */ -@ApiModel( - description = - "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution { - public static final String SERIALIZED_NAME_PREFERENCE = "preference"; - - @SerializedName(SERIALIZED_NAME_PREFERENCE) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - preference; - - public static final String SERIALIZED_NAME_WEIGHT = "weight"; - - @SerializedName(SERIALIZED_NAME_WEIGHT) - private Integer weight; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - preference( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - preference) { - - this.preference = preference; - return this; - } - - /** - * Get preference - * - * @return preference - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference - getPreference() { - return preference; - } - - public void setPreference( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreference preference) { - this.preference = preference; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - weight(Integer weight) { - - this.weight = weight; - return this; - } - - /** - * Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - * - * @return weight - */ - @ApiModelProperty( - required = true, - value = - "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.") - public Integer getWeight() { - return weight; - } - - public void setWeight(Integer weight) { - this.weight = weight; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution) - o; - return Objects.equals( - this.preference, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - .preference) - && Objects.equals( - this.weight, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution - .weight); - } - - @Override - public int hashCode() { - return Objects.hash(preference, weight); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); - sb.append(" preference: ").append(toIndentedString(preference)).append("\n"); - sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java deleted file mode 100644 index d068374c73..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * If the affinity requirements specified by this field are not met at scheduling time, the pod will - * not be scheduled onto the node. If the affinity requirements specified by this field cease to be - * met at some point during pod execution (e.g. due to an update), the system may or may not try to - * eventually evict the pod from its node. - */ -@ApiModel( - description = - "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution { - public static final String SERIALIZED_NAME_NODE_SELECTOR_TERMS = "nodeSelectorTerms"; - - @SerializedName(SERIALIZED_NAME_NODE_SELECTOR_TERMS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> - nodeSelectorTerms = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>(); - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - nodeSelectorTerms( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> - nodeSelectorTerms) { - - this.nodeSelectorTerms = nodeSelectorTerms; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - addNodeSelectorTermsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - nodeSelectorTermsItem) { - this.nodeSelectorTerms.add(nodeSelectorTermsItem); - return this; - } - - /** - * Required. A list of node selector terms. The terms are ORed. - * - * @return nodeSelectorTerms - */ - @ApiModelProperty( - required = true, - value = "Required. A list of node selector terms. The terms are ORed.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> - getNodeSelectorTerms() { - return nodeSelectorTerms; - } - - public void setNodeSelectorTerms( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms> - nodeSelectorTerms) { - this.nodeSelectorTerms = nodeSelectorTerms; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) - o; - return Objects.equals( - this.nodeSelectorTerms, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution - .nodeSelectorTerms); - } - - @Override - public int hashCode() { - return Objects.hash(nodeSelectorTerms); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); - sb.append(" nodeSelectorTerms: ").append(toIndentedString(nodeSelectorTerms)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java deleted file mode 100644 index ab5e0356de..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms.java +++ /dev/null @@ -1,185 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * A null or empty node selector term matches no objects. The requirements of them are ANDed. The - * TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - */ -@ApiModel( - description = - "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions = null; - - public static final String SERIALIZED_NAME_MATCH_FIELDS = "matchFields"; - - @SerializedName(SERIALIZED_NAME_MATCH_FIELDS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields = null; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - matchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - addMatchExpressionsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * A list of node selector requirements by node's labels. - * - * @return matchExpressions - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of node selector requirements by node's labels.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - getMatchExpressions() { - return matchExpressions; - } - - public void setMatchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchExpressions) { - this.matchExpressions = matchExpressions; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - matchFields( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields) { - - this.matchFields = matchFields; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - addMatchFieldsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions - matchFieldsItem) { - if (this.matchFields == null) { - this.matchFields = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions>(); - } - this.matchFields.add(matchFieldsItem); - return this; - } - - /** - * A list of node selector requirements by node's fields. - * - * @return matchFields - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of node selector requirements by node's fields.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - getMatchFields() { - return matchFields; - } - - public void setMatchFields( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityPreferenceMatchExpressions> - matchFields) { - this.matchFields = matchFields; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms) - o; - return Objects.equals( - this.matchExpressions, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - .matchExpressions) - && Objects.equals( - this.matchFields, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms - .matchFields); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchFields: ").append(toIndentedString(matchFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java deleted file mode 100644 index ad512ea28d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity.java +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as - * some other pod(s)). - */ -@ApiModel( - description = - "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "preferredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution = null; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "requiredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - preferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - addPreferredDuringSchedulingIgnoredDuringExecutionItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add( - preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions - * specified by this field, but it may choose a node that violates one or more of the expressions. - * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node - * that meets all of the scheduling requirements (resource request, requiredDuringScheduling - * affinity expressions, etc.), compute a sum by iterating through the elements of this field and - * adding \"weight\" to the sum if the node has pods which matches the corresponding - * podAffinityTerm; the node(s) with the highest sum are the most preferred. - * - * @return preferredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - public void setPreferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - requiredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - addRequiredDuringSchedulingIgnoredDuringExecutionItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - requiredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { - this.requiredDuringSchedulingIgnoredDuringExecution = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); - } - this.requiredDuringSchedulingIgnoredDuringExecution.add( - requiredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * If the affinity requirements specified by this field are not met at scheduling time, the pod - * will not be scheduled onto the node. If the affinity requirements specified by this field cease - * to be met at some point during pod execution (e.g. due to a pod label update), the system may - * or may not try to eventually evict the pod from its node. When there are multiple elements, the - * lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be - * satisfied. - * - * @return requiredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - public void setRequiredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity) o; - return Objects.equals( - this.preferredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - .preferredDuringSchedulingIgnoredDuringExecution) - && Objects.equals( - this.requiredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity - .requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash( - preferredDuringSchedulingIgnoredDuringExecution, - requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java deleted file mode 100644 index 414717b6dc..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Required. A pod affinity term, associated with the corresponding weight. */ -@ApiModel(description = "Required. A pod affinity term, associated with the corresponding weight.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm { - public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; - - @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) - private - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector; - - public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; - - @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; - - public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; - - @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) - private String topologyKey; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - labelSelector( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector) { - - this.labelSelector = labelSelector; - return this; - } - - /** - * Get labelSelector - * - * @return labelSelector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - getLabelSelector() { - return labelSelector; - } - - public void setLabelSelector( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector) { - this.labelSelector = labelSelector; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - namespaces(List namespaces) { - - this.namespaces = namespaces; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - addNamespacesItem(String namespacesItem) { - if (this.namespaces == null) { - this.namespaces = new ArrayList(); - } - this.namespaces.add(namespacesItem); - return this; - } - - /** - * namespaces specifies which namespaces the labelSelector applies to (matches against); null or - * empty list means \"this pod's namespace\" - * - * @return namespaces - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") - public List getNamespaces() { - return namespaces; - } - - public void setNamespaces(List namespaces) { - this.namespaces = namespaces; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - topologyKey(String topologyKey) { - - this.topologyKey = topologyKey; - return this; - } - - /** - * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods - * matching the labelSelector in the specified namespaces, where co-located is defined as running - * on a node whose value of the label with key topologyKey matches that of any node on which any - * of the selected pods is running. Empty topologyKey is not allowed. - * - * @return topologyKey - */ - @ApiModelProperty( - required = true, - value = - "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") - public String getTopologyKey() { - return topologyKey; - } - - public void setTopologyKey(String topologyKey) { - this.topologyKey = topologyKey; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm) - o; - return Objects.equals( - this.labelSelector, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - .labelSelector) - && Objects.equals( - this.namespaces, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - .namespaces) - && Objects.equals( - this.topologyKey, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - .topologyKey); - } - - @Override - public int hashCode() { - return Objects.hash(labelSelector, namespaces, topologyKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm {\n"); - sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); - sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java deleted file mode 100644 index b2101c508d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector.java +++ /dev/null @@ -1,175 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** A label query over a set of resources, in this case pods. */ -@ApiModel(description = "A label query over a set of resources, in this case pods.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector { - public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions"; - - @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> - matchExpressions = null; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = null; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - matchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> - matchExpressions) { - - this.matchExpressions = matchExpressions; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - addMatchExpressionsItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - matchExpressionsItem) { - if (this.matchExpressions == null) { - this.matchExpressions = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions>(); - } - this.matchExpressions.add(matchExpressionsItem); - return this; - } - - /** - * matchExpressions is a list of label selector requirements. The requirements are ANDed. - * - * @return matchExpressions - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "matchExpressions is a list of label selector requirements. The requirements are ANDed.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> - getMatchExpressions() { - return matchExpressions; - } - - public void setMatchExpressions( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions> - matchExpressions) { - this.matchExpressions = matchExpressions; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is - * equivalent to an element of matchExpressions, whose key field is \"key\", the - * operator is \"In\", and the values array contains only \"value\". The - * requirements are ANDed. - * - * @return matchLabels - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") - public Map getMatchLabels() { - return matchLabels; - } - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector) - o; - return Objects.equals( - this.matchExpressions, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - .matchExpressions) - && Objects.equals( - this.matchLabels, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - .matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(matchExpressions, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector {\n"); - sb.append(" matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java deleted file mode 100644 index 7852e45780..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * A label selector requirement is a selector that contains values, a key, and an operator that - * relates the key and values. - */ -@ApiModel( - description = - "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_VALUES = "values"; - - @SerializedName(SERIALIZED_NAME_VALUES) - private List values = null; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - key(String key) { - - this.key = key; - return this; - } - - /** - * key is the label key that the selector applies to. - * - * @return key - */ - @ApiModelProperty(required = true, value = "key is the label key that the selector applies to.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * operator represents a key's relationship to a set of values. Valid operators are In, NotIn, - * Exists and DoesNotExist. - * - * @return operator - */ - @ApiModelProperty( - required = true, - value = - "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.") - public String getOperator() { - return operator; - } - - public void setOperator(String operator) { - this.operator = operator; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - values(List values) { - - this.values = values; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(valuesItem); - return this; - } - - /** - * values is an array of string values. If the operator is In or NotIn, the values array must be - * non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This - * array is replaced during a strategic merge patch. - * - * @return values - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.") - public List getValues() { - return values; - } - - public void setValues(List values) { - this.values = values; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions) - o; - return Objects.equals( - this.key, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - .key) - && Objects.equals( - this.operator, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - .operator) - && Objects.equals( - this.values, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions - .values); - } - - @Override - public int hashCode() { - return Objects.hash(key, operator, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelectorMatchExpressions {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java deleted file mode 100644 index d42c3c77b5..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution.java +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the - * most preferred node(s) - */ -@ApiModel( - description = - "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution { - public static final String SERIALIZED_NAME_POD_AFFINITY_TERM = "podAffinityTerm"; - - @SerializedName(SERIALIZED_NAME_POD_AFFINITY_TERM) - private V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - podAffinityTerm; - - public static final String SERIALIZED_NAME_WEIGHT = "weight"; - - @SerializedName(SERIALIZED_NAME_WEIGHT) - private Integer weight; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - podAffinityTerm( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - podAffinityTerm) { - - this.podAffinityTerm = podAffinityTerm; - return this; - } - - /** - * Get podAffinityTerm - * - * @return podAffinityTerm - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - getPodAffinityTerm() { - return podAffinityTerm; - } - - public void setPodAffinityTerm( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTerm - podAffinityTerm) { - this.podAffinityTerm = podAffinityTerm; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - weight(Integer weight) { - - this.weight = weight; - return this; - } - - /** - * weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - * - * @return weight - */ - @ApiModelProperty( - required = true, - value = - "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.") - public Integer getWeight() { - return weight; - } - - public void setWeight(Integer weight) { - this.weight = weight; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution) - o; - return Objects.equals( - this.podAffinityTerm, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - .podAffinityTerm) - && Objects.equals( - this.weight, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - .weight); - } - - @Override - public int hashCode() { - return Objects.hash(podAffinityTerm, weight); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {\n"); - sb.append(" podAffinityTerm: ").append(toIndentedString(podAffinityTerm)).append("\n"); - sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java deleted file mode 100644 index 2a70aba8fc..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution.java +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Defines a set of pods (namely those matching the labelSelector relative to the given - * namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) - * with, where co-located is defined as running on a node whose value of the label with key - * <topologyKey> matches that of any node on which a pod of the set of pods is running - */ -@ApiModel( - description = - "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public -class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution { - public static final String SERIALIZED_NAME_LABEL_SELECTOR = "labelSelector"; - - @SerializedName(SERIALIZED_NAME_LABEL_SELECTOR) - private - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector; - - public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; - - @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; - - public static final String SERIALIZED_NAME_TOPOLOGY_KEY = "topologyKey"; - - @SerializedName(SERIALIZED_NAME_TOPOLOGY_KEY) - private String topologyKey; - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - labelSelector( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector) { - - this.labelSelector = labelSelector; - return this; - } - - /** - * Get labelSelector - * - * @return labelSelector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - getLabelSelector() { - return labelSelector; - } - - public void setLabelSelector( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPodAffinityTermLabelSelector - labelSelector) { - this.labelSelector = labelSelector; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - namespaces(List namespaces) { - - this.namespaces = namespaces; - return this; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - addNamespacesItem(String namespacesItem) { - if (this.namespaces == null) { - this.namespaces = new ArrayList(); - } - this.namespaces.add(namespacesItem); - return this; - } - - /** - * namespaces specifies which namespaces the labelSelector applies to (matches against); null or - * empty list means \"this pod's namespace\" - * - * @return namespaces - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"") - public List getNamespaces() { - return namespaces; - } - - public void setNamespaces(List namespaces) { - this.namespaces = namespaces; - } - - public - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - topologyKey(String topologyKey) { - - this.topologyKey = topologyKey; - return this; - } - - /** - * This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods - * matching the labelSelector in the specified namespaces, where co-located is defined as running - * on a node whose value of the label with key topologyKey matches that of any node on which any - * of the selected pods is running. Empty topologyKey is not allowed. - * - * @return topologyKey - */ - @ApiModelProperty( - required = true, - value = - "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.") - public String getTopologyKey() { - return topologyKey; - } - - public void setTopologyKey(String topologyKey) { - this.topologyKey = topologyKey; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution) - o; - return Objects.equals( - this.labelSelector, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - .labelSelector) - && Objects.equals( - this.namespaces, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - .namespaces) - && Objects.equals( - this.topologyKey, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - .topologyKey); - } - - @Override - public int hashCode() { - return Objects.hash(labelSelector, namespaces, topologyKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {\n"); - sb.append(" labelSelector: ").append(toIndentedString(labelSelector)).append("\n"); - sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" topologyKey: ").append(toIndentedString(topologyKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java deleted file mode 100644 index 83fd3438a4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity.java +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, - * etc. as some other pod(s)). - */ -@ApiModel( - description = - "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity { - public static final String SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "preferredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution = null; - - public static final String SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION = - "requiredDuringSchedulingIgnoredDuringExecution"; - - @SerializedName(SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION) - private List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution = null; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - preferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - addPreferredDuringSchedulingIgnoredDuringExecutionItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution - preferredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.preferredDuringSchedulingIgnoredDuringExecution == null) { - this.preferredDuringSchedulingIgnoredDuringExecution = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>(); - } - this.preferredDuringSchedulingIgnoredDuringExecution.add( - preferredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions - * specified by this field, but it may choose a node that violates one or more of the expressions. - * The node that is most preferred is the one with the greatest sum of weights, i.e. for each node - * that meets all of the scheduling requirements (resource request, requiredDuringScheduling - * anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field - * and adding \"weight\" to the sum if the node has pods which matches the corresponding - * podAffinityTerm; the node(s) with the highest sum are the most preferred. - * - * @return preferredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - getPreferredDuringSchedulingIgnoredDuringExecution() { - return preferredDuringSchedulingIgnoredDuringExecution; - } - - public void setPreferredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution> - preferredDuringSchedulingIgnoredDuringExecution) { - this.preferredDuringSchedulingIgnoredDuringExecution = - preferredDuringSchedulingIgnoredDuringExecution; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - requiredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution) { - - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - return this; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - addRequiredDuringSchedulingIgnoredDuringExecutionItem( - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution - requiredDuringSchedulingIgnoredDuringExecutionItem) { - if (this.requiredDuringSchedulingIgnoredDuringExecution == null) { - this.requiredDuringSchedulingIgnoredDuringExecution = - new ArrayList< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>(); - } - this.requiredDuringSchedulingIgnoredDuringExecution.add( - requiredDuringSchedulingIgnoredDuringExecutionItem); - return this; - } - - /** - * If the anti-affinity requirements specified by this field are not met at scheduling time, the - * pod will not be scheduled onto the node. If the anti-affinity requirements specified by this - * field cease to be met at some point during pod execution (e.g. due to a pod label update), the - * system may or may not try to eventually evict the pod from its node. When there are multiple - * elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all - * terms must be satisfied. - * - * @return requiredDuringSchedulingIgnoredDuringExecution - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.") - public List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - getRequiredDuringSchedulingIgnoredDuringExecution() { - return requiredDuringSchedulingIgnoredDuringExecution; - } - - public void setRequiredDuringSchedulingIgnoredDuringExecution( - List< - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution> - requiredDuringSchedulingIgnoredDuringExecution) { - this.requiredDuringSchedulingIgnoredDuringExecution = - requiredDuringSchedulingIgnoredDuringExecution; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity) o; - return Objects.equals( - this.preferredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - .preferredDuringSchedulingIgnoredDuringExecution) - && Objects.equals( - this.requiredDuringSchedulingIgnoredDuringExecution, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity - .requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public int hashCode() { - return Objects.hash( - preferredDuringSchedulingIgnoredDuringExecution, - requiredDuringSchedulingIgnoredDuringExecution); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( - "class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecAffinityPodAntiAffinity {\n"); - sb.append(" preferredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(preferredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append(" requiredDuringSchedulingIgnoredDuringExecution: ") - .append(toIndentedString(requiredDuringSchedulingIgnoredDuringExecution)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java deleted file mode 100644 index bd0c65dbb3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.java +++ /dev/null @@ -1,231 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The pod this Toleration is attached to tolerates any taint that matches the triple - * <key,value,effect> using the matching operator <operator>. - */ -@ApiModel( - description = - "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations { - public static final String SERIALIZED_NAME_EFFECT = "effect"; - - @SerializedName(SERIALIZED_NAME_EFFECT) - private String effect; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_OPERATOR = "operator"; - - @SerializedName(SERIALIZED_NAME_OPERATOR) - private String operator; - - public static final String SERIALIZED_NAME_TOLERATION_SECONDS = "tolerationSeconds"; - - @SerializedName(SERIALIZED_NAME_TOLERATION_SECONDS) - private Long tolerationSeconds; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations effect(String effect) { - - this.effect = effect; - return this; - } - - /** - * Effect indicates the taint effect to match. Empty means match all taint effects. When - * specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - * - * @return effect - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.") - public String getEffect() { - return effect; - } - - public void setEffect(String effect) { - this.effect = effect; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations key(String key) { - - this.key = key; - return this; - } - - /** - * Key is the taint key that the toleration applies to. Empty means match all taint keys. If the - * key is empty, operator must be Exists; this combination means to match all values and all keys. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations operator(String operator) { - - this.operator = operator; - return this; - } - - /** - * Operator represents a key's relationship to the value. Valid operators are Exists and - * Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can - * tolerate all taints of a particular category. - * - * @return operator - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.") - public String getOperator() { - return operator; - } - - public void setOperator(String operator) { - this.operator = operator; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations tolerationSeconds( - Long tolerationSeconds) { - - this.tolerationSeconds = tolerationSeconds; - return this; - } - - /** - * TolerationSeconds represents the period of time the toleration (which must be of effect - * NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, - * which means tolerate the taint forever (do not evict). Zero and negative values will be treated - * as 0 (evict immediately) by the system. - * - * @return tolerationSeconds - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.") - public Long getTolerationSeconds() { - return tolerationSeconds; - } - - public void setTolerationSeconds(Long tolerationSeconds) { - this.tolerationSeconds = tolerationSeconds; - } - - public V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations value(String value) { - - this.value = value; - return this; - } - - /** - * Value is the taint value the toleration matches to. If the operator is Exists, the value should - * be empty, otherwise just a regular string. - * - * @return value - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.") - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations = - (V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations) o; - return Objects.equals( - this.effect, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.effect) - && Objects.equals( - this.key, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.key) - && Objects.equals( - this.operator, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.operator) - && Objects.equals( - this.tolerationSeconds, - v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.tolerationSeconds) - && Objects.equals( - this.value, v1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations.value); - } - - @Override - public int hashCode() { - return Objects.hash(effect, key, operator, tolerationSeconds, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeHttp01IngressPodTemplateSpecTolerations {\n"); - sb.append(" effect: ").append(toIndentedString(effect)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" tolerationSeconds: ").append(toIndentedString(tolerationSeconds)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java deleted file mode 100644 index 16e179cd37..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmePrivateKeySecretRef.java +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * PrivateKey is the name of a Kubernetes Secret resource that will be used to store the - * automatically generated ACME account private key. Optionally, a `key` may be specified - * to select a specific entry within the named Secret resource. If `key` is not specified, - * a default of `tls.key` will be used. - */ -@ApiModel( - description = - "PrivateKey is the name of a Kubernetes Secret resource that will be used to store the automatically generated ACME account private key. Optionally, a `key` may be specified to select a specific entry within the named Secret resource. If `key` is not specified, a default of `tls.key` will be used.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmePrivateKeySecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecAcmePrivateKeySecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecAcmePrivateKeySecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmePrivateKeySecretRef v1alpha2IssuerSpecAcmePrivateKeySecretRef = - (V1alpha2IssuerSpecAcmePrivateKeySecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecAcmePrivateKeySecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecAcmePrivateKeySecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmePrivateKeySecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java deleted file mode 100644 index d43fb31a99..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSelector.java +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * Selector selects a set of DNSNames on the Certificate resource that should be solved using this - * challenge solver. If not specified, the solver will be treated as the 'default' solver - * with the lowest priority, i.e. if any other solver has a more specific match, it will be used - * instead. - */ -@ApiModel( - description = - "Selector selects a set of DNSNames on the Certificate resource that should be solved using this challenge solver. If not specified, the solver will be treated as the 'default' solver with the lowest priority, i.e. if any other solver has a more specific match, it will be used instead.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeSelector { - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = null; - - public static final String SERIALIZED_NAME_DNS_ZONES = "dnsZones"; - - @SerializedName(SERIALIZED_NAME_DNS_ZONES) - private List dnsZones = null; - - public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels"; - - @SerializedName(SERIALIZED_NAME_MATCH_LABELS) - private Map matchLabels = null; - - public V1alpha2IssuerSpecAcmeSelector dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1alpha2IssuerSpecAcmeSelector addDnsNamesItem(String dnsNamesItem) { - if (this.dnsNames == null) { - this.dnsNames = new ArrayList(); - } - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * List of DNSNames that this solver will be used to solve. If specified and a match is found, a - * dnsNames selector will take precedence over a dnsZones selector. If multiple solvers match with - * the same dnsNames value, the solver with the most matching labels in matchLabels will be - * selected. If neither has more matches, the solver defined earlier in the list will be selected. - * - * @return dnsNames - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of DNSNames that this solver will be used to solve. If specified and a match is found, a dnsNames selector will take precedence over a dnsZones selector. If multiple solvers match with the same dnsNames value, the solver with the most matching labels in matchLabels will be selected. If neither has more matches, the solver defined earlier in the list will be selected.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1alpha2IssuerSpecAcmeSelector dnsZones(List dnsZones) { - - this.dnsZones = dnsZones; - return this; - } - - public V1alpha2IssuerSpecAcmeSelector addDnsZonesItem(String dnsZonesItem) { - if (this.dnsZones == null) { - this.dnsZones = new ArrayList(); - } - this.dnsZones.add(dnsZonesItem); - return this; - } - - /** - * List of DNSZones that this solver will be used to solve. The most specific DNS zone match - * specified here will take precedence over other DNS zone matches, so a solver specifying - * sys.example.com will be selected over one specifying example.com for the domain - * www.sys.example.com. If multiple solvers match with the same dnsZones value, the solver with - * the most matching labels in matchLabels will be selected. If neither has more matches, the - * solver defined earlier in the list will be selected. - * - * @return dnsZones - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of DNSZones that this solver will be used to solve. The most specific DNS zone match specified here will take precedence over other DNS zone matches, so a solver specifying sys.example.com will be selected over one specifying example.com for the domain www.sys.example.com. If multiple solvers match with the same dnsZones value, the solver with the most matching labels in matchLabels will be selected. If neither has more matches, the solver defined earlier in the list will be selected.") - public List getDnsZones() { - return dnsZones; - } - - public void setDnsZones(List dnsZones) { - this.dnsZones = dnsZones; - } - - public V1alpha2IssuerSpecAcmeSelector matchLabels(Map matchLabels) { - - this.matchLabels = matchLabels; - return this; - } - - public V1alpha2IssuerSpecAcmeSelector putMatchLabelsItem(String key, String matchLabelsItem) { - if (this.matchLabels == null) { - this.matchLabels = new HashMap(); - } - this.matchLabels.put(key, matchLabelsItem); - return this; - } - - /** - * A label selector that is used to refine the set of certificate's that this challenge solver - * will apply to. - * - * @return matchLabels - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "A label selector that is used to refine the set of certificate's that this challenge solver will apply to.") - public Map getMatchLabels() { - return matchLabels; - } - - public void setMatchLabels(Map matchLabels) { - this.matchLabels = matchLabels; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeSelector v1alpha2IssuerSpecAcmeSelector = - (V1alpha2IssuerSpecAcmeSelector) o; - return Objects.equals(this.dnsNames, v1alpha2IssuerSpecAcmeSelector.dnsNames) - && Objects.equals(this.dnsZones, v1alpha2IssuerSpecAcmeSelector.dnsZones) - && Objects.equals(this.matchLabels, v1alpha2IssuerSpecAcmeSelector.matchLabels); - } - - @Override - public int hashCode() { - return Objects.hash(dnsNames, dnsZones, matchLabels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeSelector {\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" dnsZones: ").append(toIndentedString(dnsZones)).append("\n"); - sb.append(" matchLabels: ").append(toIndentedString(matchLabels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java deleted file mode 100644 index 64d32fed84..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecAcmeSolvers.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 - * may be provided. - */ -@ApiModel( - description = - "Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 may be provided.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecAcmeSolvers { - public static final String SERIALIZED_NAME_DNS01 = "dns01"; - - @SerializedName(SERIALIZED_NAME_DNS01) - private V1alpha2IssuerSpecAcmeDns01 dns01; - - public static final String SERIALIZED_NAME_HTTP01 = "http01"; - - @SerializedName(SERIALIZED_NAME_HTTP01) - private V1alpha2IssuerSpecAcmeHttp01 http01; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1alpha2IssuerSpecAcmeSelector selector; - - public V1alpha2IssuerSpecAcmeSolvers dns01(V1alpha2IssuerSpecAcmeDns01 dns01) { - - this.dns01 = dns01; - return this; - } - - /** - * Get dns01 - * - * @return dns01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01 getDns01() { - return dns01; - } - - public void setDns01(V1alpha2IssuerSpecAcmeDns01 dns01) { - this.dns01 = dns01; - } - - public V1alpha2IssuerSpecAcmeSolvers http01(V1alpha2IssuerSpecAcmeHttp01 http01) { - - this.http01 = http01; - return this; - } - - /** - * Get http01 - * - * @return http01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { - return http01; - } - - public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { - this.http01 = http01; - } - - public V1alpha2IssuerSpecAcmeSolvers selector(V1alpha2IssuerSpecAcmeSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * - * @return selector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeSelector getSelector() { - return selector; - } - - public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { - this.selector = selector; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecAcmeSolvers v1alpha2IssuerSpecAcmeSolvers = (V1alpha2IssuerSpecAcmeSolvers) o; - return Objects.equals(this.dns01, v1alpha2IssuerSpecAcmeSolvers.dns01) - && Objects.equals(this.http01, v1alpha2IssuerSpecAcmeSolvers.http01) - && Objects.equals(this.selector, v1alpha2IssuerSpecAcmeSolvers.selector); - } - - @Override - public int hashCode() { - return Objects.hash(dns01, http01, selector); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecAcmeSolvers {\n"); - sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); - sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java deleted file mode 100644 index 7b8715720d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecCa.java +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * CA configures this issuer to sign certificates using a signing CA keypair stored in a Secret - * resource. This is used to build internal PKIs that are managed by cert-manager. - */ -@ApiModel( - description = - "CA configures this issuer to sign certificates using a signing CA keypair stored in a Secret resource. This is used to build internal PKIs that are managed by cert-manager.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecCa { - public static final String SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS = "crlDistributionPoints"; - - @SerializedName(SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS) - private List crlDistributionPoints = null; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public V1alpha2IssuerSpecCa crlDistributionPoints(List crlDistributionPoints) { - - this.crlDistributionPoints = crlDistributionPoints; - return this; - } - - public V1alpha2IssuerSpecCa addCrlDistributionPointsItem(String crlDistributionPointsItem) { - if (this.crlDistributionPoints == null) { - this.crlDistributionPoints = new ArrayList(); - } - this.crlDistributionPoints.add(crlDistributionPointsItem); - return this; - } - - /** - * The CRL distribution points is an X.509 v3 certificate extension which identifies the location - * of the CRL from which the revocation of this certificate can be checked. If not set, - * certificates will be issued without distribution points set. - * - * @return crlDistributionPoints - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The CRL distribution points is an X.509 v3 certificate extension which identifies the location of the CRL from which the revocation of this certificate can be checked. If not set, certificates will be issued without distribution points set.") - public List getCrlDistributionPoints() { - return crlDistributionPoints; - } - - public void setCrlDistributionPoints(List crlDistributionPoints) { - this.crlDistributionPoints = crlDistributionPoints; - } - - public V1alpha2IssuerSpecCa secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * SecretName is the name of the secret used to sign Certificates issued by this Issuer. - * - * @return secretName - */ - @ApiModelProperty( - required = true, - value = - "SecretName is the name of the secret used to sign Certificates issued by this Issuer.") - public String getSecretName() { - return secretName; - } - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecCa v1alpha2IssuerSpecCa = (V1alpha2IssuerSpecCa) o; - return Objects.equals(this.crlDistributionPoints, v1alpha2IssuerSpecCa.crlDistributionPoints) - && Objects.equals(this.secretName, v1alpha2IssuerSpecCa.secretName); - } - - @Override - public int hashCode() { - return Objects.hash(crlDistributionPoints, secretName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecCa {\n"); - sb.append(" crlDistributionPoints: ") - .append(toIndentedString(crlDistributionPoints)) - .append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java deleted file mode 100644 index ddb5146127..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecSelfSigned.java +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * SelfSigned configures this issuer to 'self sign' certificates using the private key used - * to create the CertificateRequest object. - */ -@ApiModel( - description = - "SelfSigned configures this issuer to 'self sign' certificates using the private key used to create the CertificateRequest object.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecSelfSigned { - public static final String SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS = "crlDistributionPoints"; - - @SerializedName(SERIALIZED_NAME_CRL_DISTRIBUTION_POINTS) - private List crlDistributionPoints = null; - - public V1alpha2IssuerSpecSelfSigned crlDistributionPoints(List crlDistributionPoints) { - - this.crlDistributionPoints = crlDistributionPoints; - return this; - } - - public V1alpha2IssuerSpecSelfSigned addCrlDistributionPointsItem( - String crlDistributionPointsItem) { - if (this.crlDistributionPoints == null) { - this.crlDistributionPoints = new ArrayList(); - } - this.crlDistributionPoints.add(crlDistributionPointsItem); - return this; - } - - /** - * The CRL distribution points is an X.509 v3 certificate extension which identifies the location - * of the CRL from which the revocation of this certificate can be checked. If not set certificate - * will be issued without CDP. Values are strings. - * - * @return crlDistributionPoints - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The CRL distribution points is an X.509 v3 certificate extension which identifies the location of the CRL from which the revocation of this certificate can be checked. If not set certificate will be issued without CDP. Values are strings.") - public List getCrlDistributionPoints() { - return crlDistributionPoints; - } - - public void setCrlDistributionPoints(List crlDistributionPoints) { - this.crlDistributionPoints = crlDistributionPoints; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecSelfSigned v1alpha2IssuerSpecSelfSigned = (V1alpha2IssuerSpecSelfSigned) o; - return Objects.equals( - this.crlDistributionPoints, v1alpha2IssuerSpecSelfSigned.crlDistributionPoints); - } - - @Override - public int hashCode() { - return Objects.hash(crlDistributionPoints); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecSelfSigned {\n"); - sb.append(" crlDistributionPoints: ") - .append(toIndentedString(crlDistributionPoints)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java deleted file mode 100644 index 92bdf63502..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVault.java +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Arrays; -import java.util.Objects; - -/** Vault configures this issuer to sign certificates using a HashiCorp Vault PKI backend. */ -@ApiModel( - description = - "Vault configures this issuer to sign certificates using a HashiCorp Vault PKI backend.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVault { - public static final String SERIALIZED_NAME_AUTH = "auth"; - - @SerializedName(SERIALIZED_NAME_AUTH) - private V1alpha2IssuerSpecVaultAuth auth; - - public static final String SERIALIZED_NAME_CA_BUNDLE = "caBundle"; - - @SerializedName(SERIALIZED_NAME_CA_BUNDLE) - private byte[] caBundle; - - public static final String SERIALIZED_NAME_PATH = "path"; - - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_SERVER = "server"; - - @SerializedName(SERIALIZED_NAME_SERVER) - private String server; - - public V1alpha2IssuerSpecVault auth(V1alpha2IssuerSpecVaultAuth auth) { - - this.auth = auth; - return this; - } - - /** - * Get auth - * - * @return auth - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecVaultAuth getAuth() { - return auth; - } - - public void setAuth(V1alpha2IssuerSpecVaultAuth auth) { - this.auth = auth; - } - - public V1alpha2IssuerSpecVault caBundle(byte[] caBundle) { - - this.caBundle = caBundle; - return this; - } - - /** - * PEM encoded CA bundle used to validate Vault server certificate. Only used if the Server URL is - * using HTTPS protocol. This parameter is ignored for plain HTTP protocol connection. If not set - * the system root certificates are used to validate the TLS connection. - * - * @return caBundle - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "PEM encoded CA bundle used to validate Vault server certificate. Only used if the Server URL is using HTTPS protocol. This parameter is ignored for plain HTTP protocol connection. If not set the system root certificates are used to validate the TLS connection.") - public byte[] getCaBundle() { - return caBundle; - } - - public void setCaBundle(byte[] caBundle) { - this.caBundle = caBundle; - } - - public V1alpha2IssuerSpecVault path(String path) { - - this.path = path; - return this; - } - - /** - * Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g: - * \"my_pki_mount/sign/my-role-name\". - * - * @return path - */ - @ApiModelProperty( - required = true, - value = - "Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g: \"my_pki_mount/sign/my-role-name\".") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public V1alpha2IssuerSpecVault server(String server) { - - this.server = server; - return this; - } - - /** - * Server is the connection address for the Vault server, e.g: - * \"https://vault.example.com:8200\". - * - * @return server - */ - @ApiModelProperty( - required = true, - value = - "Server is the connection address for the Vault server, e.g: \"https://vault.example.com:8200\".") - public String getServer() { - return server; - } - - public void setServer(String server) { - this.server = server; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVault v1alpha2IssuerSpecVault = (V1alpha2IssuerSpecVault) o; - return Objects.equals(this.auth, v1alpha2IssuerSpecVault.auth) - && Arrays.equals(this.caBundle, v1alpha2IssuerSpecVault.caBundle) - && Objects.equals(this.path, v1alpha2IssuerSpecVault.path) - && Objects.equals(this.server, v1alpha2IssuerSpecVault.server); - } - - @Override - public int hashCode() { - return Objects.hash(auth, Arrays.hashCode(caBundle), path, server); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVault {\n"); - sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); - sb.append(" caBundle: ").append(toIndentedString(caBundle)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" server: ").append(toIndentedString(server)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java deleted file mode 100644 index 73bbb8c702..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuth.java +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Auth configures how cert-manager authenticates with the Vault server. */ -@ApiModel(description = "Auth configures how cert-manager authenticates with the Vault server.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuth { - public static final String SERIALIZED_NAME_APP_ROLE = "appRole"; - - @SerializedName(SERIALIZED_NAME_APP_ROLE) - private V1alpha2IssuerSpecVaultAuthAppRole appRole; - - public static final String SERIALIZED_NAME_KUBERNETES = "kubernetes"; - - @SerializedName(SERIALIZED_NAME_KUBERNETES) - private V1alpha2IssuerSpecVaultAuthKubernetes kubernetes; - - public static final String SERIALIZED_NAME_TOKEN_SECRET_REF = "tokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef; - - public V1alpha2IssuerSpecVaultAuth appRole(V1alpha2IssuerSpecVaultAuthAppRole appRole) { - - this.appRole = appRole; - return this; - } - - /** - * Get appRole - * - * @return appRole - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVaultAuthAppRole getAppRole() { - return appRole; - } - - public void setAppRole(V1alpha2IssuerSpecVaultAuthAppRole appRole) { - this.appRole = appRole; - } - - public V1alpha2IssuerSpecVaultAuth kubernetes(V1alpha2IssuerSpecVaultAuthKubernetes kubernetes) { - - this.kubernetes = kubernetes; - return this; - } - - /** - * Get kubernetes - * - * @return kubernetes - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVaultAuthKubernetes getKubernetes() { - return kubernetes; - } - - public void setKubernetes(V1alpha2IssuerSpecVaultAuthKubernetes kubernetes) { - this.kubernetes = kubernetes; - } - - public V1alpha2IssuerSpecVaultAuth tokenSecretRef( - V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef) { - - this.tokenSecretRef = tokenSecretRef; - return this; - } - - /** - * Get tokenSecretRef - * - * @return tokenSecretRef - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVaultAuthTokenSecretRef getTokenSecretRef() { - return tokenSecretRef; - } - - public void setTokenSecretRef(V1alpha2IssuerSpecVaultAuthTokenSecretRef tokenSecretRef) { - this.tokenSecretRef = tokenSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuth v1alpha2IssuerSpecVaultAuth = (V1alpha2IssuerSpecVaultAuth) o; - return Objects.equals(this.appRole, v1alpha2IssuerSpecVaultAuth.appRole) - && Objects.equals(this.kubernetes, v1alpha2IssuerSpecVaultAuth.kubernetes) - && Objects.equals(this.tokenSecretRef, v1alpha2IssuerSpecVaultAuth.tokenSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(appRole, kubernetes, tokenSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuth {\n"); - sb.append(" appRole: ").append(toIndentedString(appRole)).append("\n"); - sb.append(" kubernetes: ").append(toIndentedString(kubernetes)).append("\n"); - sb.append(" tokenSecretRef: ").append(toIndentedString(tokenSecretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java deleted file mode 100644 index 775730ebdd..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRole.java +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * AppRole authenticates with Vault using the App Role auth mechanism, with the role and secret - * stored in a Kubernetes Secret resource. - */ -@ApiModel( - description = - "AppRole authenticates with Vault using the App Role auth mechanism, with the role and secret stored in a Kubernetes Secret resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuthAppRole { - public static final String SERIALIZED_NAME_PATH = "path"; - - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; - - @SerializedName(SERIALIZED_NAME_ROLE_ID) - private String roleId; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef; - - public V1alpha2IssuerSpecVaultAuthAppRole path(String path) { - - this.path = path; - return this; - } - - /** - * Path where the App Role authentication backend is mounted in Vault, e.g: \"approle\" - * - * @return path - */ - @ApiModelProperty( - required = true, - value = - "Path where the App Role authentication backend is mounted in Vault, e.g: \"approle\"") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public V1alpha2IssuerSpecVaultAuthAppRole roleId(String roleId) { - - this.roleId = roleId; - return this; - } - - /** - * RoleID configured in the App Role authentication backend when setting up the authentication - * backend in Vault. - * - * @return roleId - */ - @ApiModelProperty( - required = true, - value = - "RoleID configured in the App Role authentication backend when setting up the authentication backend in Vault.") - public String getRoleId() { - return roleId; - } - - public void setRoleId(String roleId) { - this.roleId = roleId; - } - - public V1alpha2IssuerSpecVaultAuthAppRole secretRef( - V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * - * @return secretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef getSecretRef() { - return secretRef; - } - - public void setSecretRef(V1alpha2IssuerSpecVaultAuthAppRoleSecretRef secretRef) { - this.secretRef = secretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuthAppRole v1alpha2IssuerSpecVaultAuthAppRole = - (V1alpha2IssuerSpecVaultAuthAppRole) o; - return Objects.equals(this.path, v1alpha2IssuerSpecVaultAuthAppRole.path) - && Objects.equals(this.roleId, v1alpha2IssuerSpecVaultAuthAppRole.roleId) - && Objects.equals(this.secretRef, v1alpha2IssuerSpecVaultAuthAppRole.secretRef); - } - - @Override - public int hashCode() { - return Objects.hash(path, roleId, secretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuthAppRole {\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java deleted file mode 100644 index 3d4d631eec..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthAppRoleSecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Reference to a key in a Secret that contains the App Role secret used to authenticate with Vault. - * The `key` field must be specified and denotes which entry within the Secret resource is - * used as the app role secret. - */ -@ApiModel( - description = - "Reference to a key in a Secret that contains the App Role secret used to authenticate with Vault. The `key` field must be specified and denotes which entry within the Secret resource is used as the app role secret.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuthAppRoleSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecVaultAuthAppRoleSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuthAppRoleSecretRef v1alpha2IssuerSpecVaultAuthAppRoleSecretRef = - (V1alpha2IssuerSpecVaultAuthAppRoleSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthAppRoleSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthAppRoleSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuthAppRoleSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java deleted file mode 100644 index bf2531fd8a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetes.java +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Kubernetes authenticates with Vault by passing the ServiceAccount token stored in the named - * Secret resource to the Vault server. - */ -@ApiModel( - description = - "Kubernetes authenticates with Vault by passing the ServiceAccount token stored in the named Secret resource to the Vault server.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuthKubernetes { - public static final String SERIALIZED_NAME_MOUNT_PATH = "mountPath"; - - @SerializedName(SERIALIZED_NAME_MOUNT_PATH) - private String mountPath; - - public static final String SERIALIZED_NAME_ROLE = "role"; - - @SerializedName(SERIALIZED_NAME_ROLE) - private String role; - - public static final String SERIALIZED_NAME_SECRET_REF = "secretRef"; - - @SerializedName(SERIALIZED_NAME_SECRET_REF) - private V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef; - - public V1alpha2IssuerSpecVaultAuthKubernetes mountPath(String mountPath) { - - this.mountPath = mountPath; - return this; - } - - /** - * The Vault mountPath here is the mount path to use when authenticating with Vault. For example, - * setting a value to `/v1/auth/foo`, will use the path `/v1/auth/foo/login` - * to authenticate with Vault. If unspecified, the default value \"/v1/auth/kubernetes\" - * will be used. - * - * @return mountPath - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The Vault mountPath here is the mount path to use when authenticating with Vault. For example, setting a value to `/v1/auth/foo`, will use the path `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the default value \"/v1/auth/kubernetes\" will be used.") - public String getMountPath() { - return mountPath; - } - - public void setMountPath(String mountPath) { - this.mountPath = mountPath; - } - - public V1alpha2IssuerSpecVaultAuthKubernetes role(String role) { - - this.role = role; - return this; - } - - /** - * A required field containing the Vault Role to assume. A Role binds a Kubernetes ServiceAccount - * with a set of Vault policies. - * - * @return role - */ - @ApiModelProperty( - required = true, - value = - "A required field containing the Vault Role to assume. A Role binds a Kubernetes ServiceAccount with a set of Vault policies.") - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public V1alpha2IssuerSpecVaultAuthKubernetes secretRef( - V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef) { - - this.secretRef = secretRef; - return this; - } - - /** - * Get secretRef - * - * @return secretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef getSecretRef() { - return secretRef; - } - - public void setSecretRef(V1alpha2IssuerSpecVaultAuthKubernetesSecretRef secretRef) { - this.secretRef = secretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuthKubernetes v1alpha2IssuerSpecVaultAuthKubernetes = - (V1alpha2IssuerSpecVaultAuthKubernetes) o; - return Objects.equals(this.mountPath, v1alpha2IssuerSpecVaultAuthKubernetes.mountPath) - && Objects.equals(this.role, v1alpha2IssuerSpecVaultAuthKubernetes.role) - && Objects.equals(this.secretRef, v1alpha2IssuerSpecVaultAuthKubernetes.secretRef); - } - - @Override - public int hashCode() { - return Objects.hash(mountPath, role, secretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuthKubernetes {\n"); - sb.append(" mountPath: ").append(toIndentedString(mountPath)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" secretRef: ").append(toIndentedString(secretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java deleted file mode 100644 index 7fb28734f5..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthKubernetesSecretRef.java +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * The required Secret field containing a Kubernetes ServiceAccount JWT used for authenticating with - * Vault. Use of 'ambient credentials' is not supported. - */ -@ApiModel( - description = - "The required Secret field containing a Kubernetes ServiceAccount JWT used for authenticating with Vault. Use of 'ambient credentials' is not supported.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuthKubernetesSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecVaultAuthKubernetesSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuthKubernetesSecretRef v1alpha2IssuerSpecVaultAuthKubernetesSecretRef = - (V1alpha2IssuerSpecVaultAuthKubernetesSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthKubernetesSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthKubernetesSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuthKubernetesSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java deleted file mode 100644 index 3579150570..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVaultAuthTokenSecretRef.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** TokenSecretRef authenticates with Vault by presenting a token. */ -@ApiModel(description = "TokenSecretRef authenticates with Vault by presenting a token.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVaultAuthTokenSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecVaultAuthTokenSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecVaultAuthTokenSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVaultAuthTokenSecretRef v1alpha2IssuerSpecVaultAuthTokenSecretRef = - (V1alpha2IssuerSpecVaultAuthTokenSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecVaultAuthTokenSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecVaultAuthTokenSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVaultAuthTokenSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java deleted file mode 100644 index b5cc761de2..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafi.java +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Venafi configures this issuer to sign certificates using a Venafi TPP or Venafi Cloud policy - * zone. - */ -@ApiModel( - description = - "Venafi configures this issuer to sign certificates using a Venafi TPP or Venafi Cloud policy zone.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVenafi { - public static final String SERIALIZED_NAME_CLOUD = "cloud"; - - @SerializedName(SERIALIZED_NAME_CLOUD) - private V1alpha2IssuerSpecVenafiCloud cloud; - - public static final String SERIALIZED_NAME_TPP = "tpp"; - - @SerializedName(SERIALIZED_NAME_TPP) - private V1alpha2IssuerSpecVenafiTpp tpp; - - public static final String SERIALIZED_NAME_ZONE = "zone"; - - @SerializedName(SERIALIZED_NAME_ZONE) - private String zone; - - public V1alpha2IssuerSpecVenafi cloud(V1alpha2IssuerSpecVenafiCloud cloud) { - - this.cloud = cloud; - return this; - } - - /** - * Get cloud - * - * @return cloud - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafiCloud getCloud() { - return cloud; - } - - public void setCloud(V1alpha2IssuerSpecVenafiCloud cloud) { - this.cloud = cloud; - } - - public V1alpha2IssuerSpecVenafi tpp(V1alpha2IssuerSpecVenafiTpp tpp) { - - this.tpp = tpp; - return this; - } - - /** - * Get tpp - * - * @return tpp - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafiTpp getTpp() { - return tpp; - } - - public void setTpp(V1alpha2IssuerSpecVenafiTpp tpp) { - this.tpp = tpp; - } - - public V1alpha2IssuerSpecVenafi zone(String zone) { - - this.zone = zone; - return this; - } - - /** - * Zone is the Venafi Policy Zone to use for this issuer. All requests made to the Venafi platform - * will be restricted by the named zone policy. This field is required. - * - * @return zone - */ - @ApiModelProperty( - required = true, - value = - "Zone is the Venafi Policy Zone to use for this issuer. All requests made to the Venafi platform will be restricted by the named zone policy. This field is required.") - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVenafi v1alpha2IssuerSpecVenafi = (V1alpha2IssuerSpecVenafi) o; - return Objects.equals(this.cloud, v1alpha2IssuerSpecVenafi.cloud) - && Objects.equals(this.tpp, v1alpha2IssuerSpecVenafi.tpp) - && Objects.equals(this.zone, v1alpha2IssuerSpecVenafi.zone); - } - - @Override - public int hashCode() { - return Objects.hash(cloud, tpp, zone); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVenafi {\n"); - sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); - sb.append(" tpp: ").append(toIndentedString(tpp)).append("\n"); - sb.append(" zone: ").append(toIndentedString(zone)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java deleted file mode 100644 index 5f01d467e3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloud.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Cloud specifies the Venafi cloud configuration settings. Only one of TPP or Cloud may be - * specified. - */ -@ApiModel( - description = - "Cloud specifies the Venafi cloud configuration settings. Only one of TPP or Cloud may be specified.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVenafiCloud { - public static final String SERIALIZED_NAME_API_TOKEN_SECRET_REF = "apiTokenSecretRef"; - - @SerializedName(SERIALIZED_NAME_API_TOKEN_SECRET_REF) - private V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public V1alpha2IssuerSpecVenafiCloud apiTokenSecretRef( - V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef) { - - this.apiTokenSecretRef = apiTokenSecretRef; - return this; - } - - /** - * Get apiTokenSecretRef - * - * @return apiTokenSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef getApiTokenSecretRef() { - return apiTokenSecretRef; - } - - public void setApiTokenSecretRef( - V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef apiTokenSecretRef) { - this.apiTokenSecretRef = apiTokenSecretRef; - } - - public V1alpha2IssuerSpecVenafiCloud url(String url) { - - this.url = url; - return this; - } - - /** - * URL is the base URL for Venafi Cloud. Defaults to \"https://api.venafi.cloud/v1\". - * - * @return url - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "URL is the base URL for Venafi Cloud. Defaults to \"https://api.venafi.cloud/v1\".") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVenafiCloud v1alpha2IssuerSpecVenafiCloud = (V1alpha2IssuerSpecVenafiCloud) o; - return Objects.equals(this.apiTokenSecretRef, v1alpha2IssuerSpecVenafiCloud.apiTokenSecretRef) - && Objects.equals(this.url, v1alpha2IssuerSpecVenafiCloud.url); - } - - @Override - public int hashCode() { - return Objects.hash(apiTokenSecretRef, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVenafiCloud {\n"); - sb.append(" apiTokenSecretRef: ").append(toIndentedString(apiTokenSecretRef)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java deleted file mode 100644 index c0fd49eca8..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** APITokenSecretRef is a secret key selector for the Venafi Cloud API token. */ -@ApiModel( - description = "APITokenSecretRef is a secret key selector for the Venafi Cloud API token.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef = - (V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef) o; - return Objects.equals(this.key, v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.key) - && Objects.equals(this.name, v1alpha2IssuerSpecVenafiCloudApiTokenSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVenafiCloudApiTokenSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java deleted file mode 100644 index e3f57fce6a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTpp.java +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Arrays; -import java.util.Objects; - -/** - * TPP specifies Trust Protection Platform configuration settings. Only one of TPP or Cloud may be - * specified. - */ -@ApiModel( - description = - "TPP specifies Trust Protection Platform configuration settings. Only one of TPP or Cloud may be specified.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVenafiTpp { - public static final String SERIALIZED_NAME_CA_BUNDLE = "caBundle"; - - @SerializedName(SERIALIZED_NAME_CA_BUNDLE) - private byte[] caBundle; - - public static final String SERIALIZED_NAME_CREDENTIALS_REF = "credentialsRef"; - - @SerializedName(SERIALIZED_NAME_CREDENTIALS_REF) - private V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public V1alpha2IssuerSpecVenafiTpp caBundle(byte[] caBundle) { - - this.caBundle = caBundle; - return this; - } - - /** - * CABundle is a PEM encoded TLS certificate to use to verify connections to the TPP instance. If - * specified, system roots will not be used and the issuing CA for the TPP instance must be - * verifiable using the provided root. If not specified, the connection will be verified using the - * cert-manager system root certificates. - * - * @return caBundle - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CABundle is a PEM encoded TLS certificate to use to verify connections to the TPP instance. If specified, system roots will not be used and the issuing CA for the TPP instance must be verifiable using the provided root. If not specified, the connection will be verified using the cert-manager system root certificates.") - public byte[] getCaBundle() { - return caBundle; - } - - public void setCaBundle(byte[] caBundle) { - this.caBundle = caBundle; - } - - public V1alpha2IssuerSpecVenafiTpp credentialsRef( - V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef) { - - this.credentialsRef = credentialsRef; - return this; - } - - /** - * Get credentialsRef - * - * @return credentialsRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecVenafiTppCredentialsRef getCredentialsRef() { - return credentialsRef; - } - - public void setCredentialsRef(V1alpha2IssuerSpecVenafiTppCredentialsRef credentialsRef) { - this.credentialsRef = credentialsRef; - } - - public V1alpha2IssuerSpecVenafiTpp url(String url) { - - this.url = url; - return this; - } - - /** - * URL is the base URL for the vedsdk endpoint of the Venafi TPP instance, for example: - * \"https://tpp.example.com/vedsdk\". - * - * @return url - */ - @ApiModelProperty( - required = true, - value = - "URL is the base URL for the vedsdk endpoint of the Venafi TPP instance, for example: \"https://tpp.example.com/vedsdk\".") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVenafiTpp v1alpha2IssuerSpecVenafiTpp = (V1alpha2IssuerSpecVenafiTpp) o; - return Arrays.equals(this.caBundle, v1alpha2IssuerSpecVenafiTpp.caBundle) - && Objects.equals(this.credentialsRef, v1alpha2IssuerSpecVenafiTpp.credentialsRef) - && Objects.equals(this.url, v1alpha2IssuerSpecVenafiTpp.url); - } - - @Override - public int hashCode() { - return Objects.hash(Arrays.hashCode(caBundle), credentialsRef, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVenafiTpp {\n"); - sb.append(" caBundle: ").append(toIndentedString(caBundle)).append("\n"); - sb.append(" credentialsRef: ").append(toIndentedString(credentialsRef)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java deleted file mode 100644 index 43a20881be..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerSpecVenafiTppCredentialsRef.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * CredentialsRef is a reference to a Secret containing the username and password for the TPP - * server. The secret must contain two keys, 'username' and 'password'. - */ -@ApiModel( - description = - "CredentialsRef is a reference to a Secret containing the username and password for the TPP server. The secret must contain two keys, 'username' and 'password'.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerSpecVenafiTppCredentialsRef { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha2IssuerSpecVenafiTppCredentialsRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerSpecVenafiTppCredentialsRef v1alpha2IssuerSpecVenafiTppCredentialsRef = - (V1alpha2IssuerSpecVenafiTppCredentialsRef) o; - return Objects.equals(this.name, v1alpha2IssuerSpecVenafiTppCredentialsRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerSpecVenafiTppCredentialsRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java deleted file mode 100644 index e6e9b08cbb..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatus.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Status of the Issuer. This is set and managed automatically. */ -@ApiModel(description = "Status of the Issuer. This is set and managed automatically.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerStatus { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1alpha2IssuerStatusAcme acme; - - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public V1alpha2IssuerStatus acme(V1alpha2IssuerStatusAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerStatusAcme getAcme() { - return acme; - } - - public void setAcme(V1alpha2IssuerStatusAcme acme) { - this.acme = acme; - } - - public V1alpha2IssuerStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1alpha2IssuerStatus addConditionsItem(V1alpha2IssuerStatusConditions conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * List of status conditions to indicate the status of a CertificateRequest. Known condition types - * are `Ready`. - * - * @return conditions - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready`.") - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerStatus v1alpha2IssuerStatus = (V1alpha2IssuerStatus) o; - return Objects.equals(this.acme, v1alpha2IssuerStatus.acme) - && Objects.equals(this.conditions, v1alpha2IssuerStatus.conditions); - } - - @Override - public int hashCode() { - return Objects.hash(acme, conditions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerStatus {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java deleted file mode 100644 index f2fa132544..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusAcme.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * ACME specific status options. This field should only be set if the Issuer is configured to use an - * ACME server to issue certificates. - */ -@ApiModel( - description = - "ACME specific status options. This field should only be set if the Issuer is configured to use an ACME server to issue certificates.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerStatusAcme { - public static final String SERIALIZED_NAME_LAST_REGISTERED_EMAIL = "lastRegisteredEmail"; - - @SerializedName(SERIALIZED_NAME_LAST_REGISTERED_EMAIL) - private String lastRegisteredEmail; - - public static final String SERIALIZED_NAME_URI = "uri"; - - @SerializedName(SERIALIZED_NAME_URI) - private String uri; - - public V1alpha2IssuerStatusAcme lastRegisteredEmail(String lastRegisteredEmail) { - - this.lastRegisteredEmail = lastRegisteredEmail; - return this; - } - - /** - * LastRegisteredEmail is the email associated with the latest registered ACME account, in order - * to track changes made to registered account associated with the Issuer - * - * @return lastRegisteredEmail - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "LastRegisteredEmail is the email associated with the latest registered ACME account, in order to track changes made to registered account associated with the Issuer") - public String getLastRegisteredEmail() { - return lastRegisteredEmail; - } - - public void setLastRegisteredEmail(String lastRegisteredEmail) { - this.lastRegisteredEmail = lastRegisteredEmail; - } - - public V1alpha2IssuerStatusAcme uri(String uri) { - - this.uri = uri; - return this; - } - - /** - * URI is the unique account identifier, which can also be used to retrieve account details from - * the CA - * - * @return uri - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "URI is the unique account identifier, which can also be used to retrieve account details from the CA") - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerStatusAcme v1alpha2IssuerStatusAcme = (V1alpha2IssuerStatusAcme) o; - return Objects.equals(this.lastRegisteredEmail, v1alpha2IssuerStatusAcme.lastRegisteredEmail) - && Objects.equals(this.uri, v1alpha2IssuerStatusAcme.uri); - } - - @Override - public int hashCode() { - return Objects.hash(lastRegisteredEmail, uri); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerStatusAcme {\n"); - sb.append(" lastRegisteredEmail: ") - .append(toIndentedString(lastRegisteredEmail)) - .append("\n"); - sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java deleted file mode 100644 index b99af8b7ab..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2IssuerStatusConditions.java +++ /dev/null @@ -1,261 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -/** IssuerCondition contains condition information for an Issuer. */ -@ApiModel(description = "IssuerCondition contains condition information for an Issuer.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2IssuerStatusConditions { - public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; - - @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) - private OffsetDateTime lastTransitionTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** Status of the condition, one of ('True', 'False', 'Unknown'). */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - TRUE("True"), - - FALSE("False"), - - UNKNOWN("Unknown"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1alpha2IssuerStatusConditions lastTransitionTime(OffsetDateTime lastTransitionTime) { - - this.lastTransitionTime = lastTransitionTime; - return this; - } - - /** - * LastTransitionTime is the timestamp corresponding to the last status change of this condition. - * - * @return lastTransitionTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") - public OffsetDateTime getLastTransitionTime() { - return lastTransitionTime; - } - - public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { - this.lastTransitionTime = lastTransitionTime; - } - - public V1alpha2IssuerStatusConditions message(String message) { - - this.message = message; - return this; - } - - /** - * Message is a human readable description of the details of the last transition, complementing - * reason. - * - * @return message - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Message is a human readable description of the details of the last transition, complementing reason.") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public V1alpha2IssuerStatusConditions reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason is a brief machine readable explanation for the condition's last transition. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Reason is a brief machine readable explanation for the condition's last transition.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1alpha2IssuerStatusConditions status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status of the condition, one of ('True', 'False', 'Unknown'). - * - * @return status - */ - @ApiModelProperty( - required = true, - value = "Status of the condition, one of ('True', 'False', 'Unknown').") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public V1alpha2IssuerStatusConditions type(String type) { - - this.type = type; - return this; - } - - /** - * Type of the condition, known values are ('Ready'). - * - * @return type - */ - @ApiModelProperty(required = true, value = "Type of the condition, known values are ('Ready').") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2IssuerStatusConditions v1alpha2IssuerStatusConditions = - (V1alpha2IssuerStatusConditions) o; - return Objects.equals( - this.lastTransitionTime, v1alpha2IssuerStatusConditions.lastTransitionTime) - && Objects.equals(this.message, v1alpha2IssuerStatusConditions.message) - && Objects.equals(this.reason, v1alpha2IssuerStatusConditions.reason) - && Objects.equals(this.status, v1alpha2IssuerStatusConditions.status) - && Objects.equals(this.type, v1alpha2IssuerStatusConditions.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastTransitionTime, message, reason, status, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2IssuerStatusConditions {\n"); - sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java deleted file mode 100644 index 326e3c2cac..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2Order.java +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Order is a type to represent an Order with an ACME server */ -@ApiModel(description = "Order is a type to represent an Order with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2Order implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3OrderSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1OrderStatus status; - - public V1alpha2Order apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2Order kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2Order metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha2Order spec(V1alpha3OrderSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3OrderSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3OrderSpec spec) { - this.spec = spec; - } - - public V1alpha2Order status(V1beta1OrderStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1OrderStatus getStatus() { - return status; - } - - public void setStatus(V1beta1OrderStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2Order v1alpha2Order = (V1alpha2Order) o; - return Objects.equals(this.apiVersion, v1alpha2Order.apiVersion) - && Objects.equals(this.kind, v1alpha2Order.kind) - && Objects.equals(this.metadata, v1alpha2Order.metadata) - && Objects.equals(this.spec, v1alpha2Order.spec) - && Objects.equals(this.status, v1alpha2Order.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2Order {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java deleted file mode 100644 index ff8932cd59..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha2OrderList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** OrderList is a list of Order */ -@ApiModel(description = "OrderList is a list of Order") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha2OrderList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha2OrderList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha2OrderList items(List items) { - - this.items = items; - return this; - } - - public V1alpha2OrderList addItemsItem(V1alpha2Order itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of orders. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha2OrderList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha2OrderList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha2OrderList v1alpha2OrderList = (V1alpha2OrderList) o; - return Objects.equals(this.apiVersion, v1alpha2OrderList.apiVersion) - && Objects.equals(this.items, v1alpha2OrderList.items) - && Objects.equals(this.kind, v1alpha2OrderList.kind) - && Objects.equals(this.metadata, v1alpha2OrderList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha2OrderList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java deleted file mode 100644 index 93bbfb93e8..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Certificate.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A Certificate resource should be created to ensure an up to date and signed x509 certificate is - * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored - * certificate will be renewed before it expires (as configured by `spec.renewBefore`). - */ -@ApiModel( - description = - "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3Certificate implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3CertificateSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateStatus status; - - public V1alpha3Certificate apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3Certificate kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3Certificate metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3Certificate spec(V1alpha3CertificateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3CertificateSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3CertificateSpec spec) { - this.spec = spec; - } - - public V1alpha3Certificate status(V1beta1CertificateStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3Certificate v1alpha3Certificate = (V1alpha3Certificate) o; - return Objects.equals(this.apiVersion, v1alpha3Certificate.apiVersion) - && Objects.equals(this.kind, v1alpha3Certificate.kind) - && Objects.equals(this.metadata, v1alpha3Certificate.metadata) - && Objects.equals(this.spec, v1alpha3Certificate.spec) - && Objects.equals(this.status, v1alpha3Certificate.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3Certificate {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java deleted file mode 100644 index bfebc17469..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateList is a list of Certificate */ -@ApiModel(description = "CertificateList is a list of Certificate") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3CertificateList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3CertificateList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3CertificateList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3CertificateList addItemsItem(V1alpha3Certificate itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificates. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3CertificateList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3CertificateList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3CertificateList v1alpha3CertificateList = (V1alpha3CertificateList) o; - return Objects.equals(this.apiVersion, v1alpha3CertificateList.apiVersion) - && Objects.equals(this.items, v1alpha3CertificateList.items) - && Objects.equals(this.kind, v1alpha3CertificateList.kind) - && Objects.equals(this.metadata, v1alpha3CertificateList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3CertificateList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java deleted file mode 100644 index 7581b0aadd..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A CertificateRequest is used to request a signed certificate from one of the configured issuers. - * All fields within the CertificateRequest's `spec` are immutable after creation. A - * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. - * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in - * time request for a certificate and cannot be re-used. - */ -@ApiModel( - description = - "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3CertificateRequest implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2CertificateRequestSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateRequestStatus status; - - public V1alpha3CertificateRequest apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3CertificateRequest kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3CertificateRequest metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3CertificateRequest spec(V1alpha2CertificateRequestSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateRequestSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2CertificateRequestSpec spec) { - this.spec = spec; - } - - public V1alpha3CertificateRequest status(V1beta1CertificateRequestStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateRequestStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateRequestStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3CertificateRequest v1alpha3CertificateRequest = (V1alpha3CertificateRequest) o; - return Objects.equals(this.apiVersion, v1alpha3CertificateRequest.apiVersion) - && Objects.equals(this.kind, v1alpha3CertificateRequest.kind) - && Objects.equals(this.metadata, v1alpha3CertificateRequest.metadata) - && Objects.equals(this.spec, v1alpha3CertificateRequest.spec) - && Objects.equals(this.status, v1alpha3CertificateRequest.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3CertificateRequest {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java deleted file mode 100644 index 964c957c4e..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateRequestList.java +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateRequestList is a list of CertificateRequest */ -@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3CertificateRequestList - implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3CertificateRequestList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3CertificateRequestList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3CertificateRequestList addItemsItem(V1alpha3CertificateRequest itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificaterequests. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3CertificateRequestList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3CertificateRequestList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3CertificateRequestList v1alpha3CertificateRequestList = - (V1alpha3CertificateRequestList) o; - return Objects.equals(this.apiVersion, v1alpha3CertificateRequestList.apiVersion) - && Objects.equals(this.items, v1alpha3CertificateRequestList.items) - && Objects.equals(this.kind, v1alpha3CertificateRequestList.kind) - && Objects.equals(this.metadata, v1alpha3CertificateRequestList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3CertificateRequestList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java deleted file mode 100644 index 4aa5981b16..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3CertificateSpec.java +++ /dev/null @@ -1,848 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Desired state of the Certificate resource. */ -@ApiModel(description = "Desired state of the Certificate resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3CertificateSpec { - public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; - - @SerializedName(SERIALIZED_NAME_COMMON_NAME) - private String commonName; - - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = null; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; - - @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) - private List emailSANs = null; - - public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; - - @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) - private List ipAddresses = null; - - public static final String SERIALIZED_NAME_IS_C_A = "isCA"; - - @SerializedName(SERIALIZED_NAME_IS_C_A) - private Boolean isCA; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1CertificateSpecIssuerRef issuerRef; - - /** - * KeyAlgorithm is the private key algorithm of the corresponding private key for this - * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 - * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - */ - @JsonAdapter(KeyAlgorithmEnum.Adapter.class) - public enum KeyAlgorithmEnum { - RSA("rsa"), - - ECDSA("ecdsa"); - - private String value; - - KeyAlgorithmEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyAlgorithmEnum fromValue(String value) { - for (KeyAlgorithmEnum b : KeyAlgorithmEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyAlgorithmEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyAlgorithmEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyAlgorithmEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KEY_ALGORITHM = "keyAlgorithm"; - - @SerializedName(SERIALIZED_NAME_KEY_ALGORITHM) - private KeyAlgorithmEnum keyAlgorithm; - - /** - * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private - * key to be encoded in. If provided, allowed values are \"pkcs1\" and - * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not - * specified, then PKCS#1 will be used by default. - */ - @JsonAdapter(KeyEncodingEnum.Adapter.class) - public enum KeyEncodingEnum { - PKCS1("pkcs1"), - - PKCS8("pkcs8"); - - private String value; - - KeyEncodingEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KeyEncodingEnum fromValue(String value) { - for (KeyEncodingEnum b : KeyEncodingEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KeyEncodingEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KeyEncodingEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KeyEncodingEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KEY_ENCODING = "keyEncoding"; - - @SerializedName(SERIALIZED_NAME_KEY_ENCODING) - private KeyEncodingEnum keyEncoding; - - public static final String SERIALIZED_NAME_KEY_SIZE = "keySize"; - - @SerializedName(SERIALIZED_NAME_KEY_SIZE) - private Integer keySize; - - public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; - - @SerializedName(SERIALIZED_NAME_KEYSTORES) - private V1beta1CertificateSpecKeystores keystores; - - public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; - - @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) - private V1alpha2CertificateSpecPrivateKey privateKey; - - public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; - - @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) - private String renewBefore; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - - @SerializedName(SERIALIZED_NAME_SUBJECT) - private V1beta1CertificateSpecSubject subject; - - public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; - - @SerializedName(SERIALIZED_NAME_URI_S_A_NS) - private List uriSANs = null; - - /** - * KeyUsage specifies valid usage contexts for keys. See: - * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: - * \"signing\", \"digital signature\", \"content commitment\", - * \"key encipherment\", \"key agreement\", \"data encipherment\", - * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher - * only\", \"any\", \"server auth\", \"client auth\", - * \"code signing\", \"email protection\", \"s/mime\", \"ipsec - * end system\", \"ipsec tunnel\", \"ipsec user\", - * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", - * \"netscape sgc\" - */ - @JsonAdapter(UsagesEnum.Adapter.class) - public enum UsagesEnum { - SIGNING("signing"), - - DIGITAL_SIGNATURE("digital signature"), - - CONTENT_COMMITMENT("content commitment"), - - KEY_ENCIPHERMENT("key encipherment"), - - KEY_AGREEMENT("key agreement"), - - DATA_ENCIPHERMENT("data encipherment"), - - CERT_SIGN("cert sign"), - - CRL_SIGN("crl sign"), - - ENCIPHER_ONLY("encipher only"), - - DECIPHER_ONLY("decipher only"), - - ANY("any"), - - SERVER_AUTH("server auth"), - - CLIENT_AUTH("client auth"), - - CODE_SIGNING("code signing"), - - EMAIL_PROTECTION("email protection"), - - S_MIME("s/mime"), - - IPSEC_END_SYSTEM("ipsec end system"), - - IPSEC_TUNNEL("ipsec tunnel"), - - IPSEC_USER("ipsec user"), - - TIMESTAMPING("timestamping"), - - OCSP_SIGNING("ocsp signing"), - - MICROSOFT_SGC("microsoft sgc"), - - NETSCAPE_SGC("netscape sgc"); - - private String value; - - UsagesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UsagesEnum fromValue(String value) { - for (UsagesEnum b : UsagesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UsagesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UsagesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_USAGES = "usages"; - - @SerializedName(SERIALIZED_NAME_USAGES) - private List usages = null; - - public V1alpha3CertificateSpec commonName(String commonName) { - - this.commonName = commonName; - return this; - } - - /** - * CommonName is a common name to be used on the Certificate. The CommonName should have a length - * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS - * clients when any subject alt name is set. This is x509 behaviour: - * https://tools.ietf.org/html/rfc6125#section-6.4.4 - * - * @return commonName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") - public String getCommonName() { - return commonName; - } - - public void setCommonName(String commonName) { - this.commonName = commonName; - } - - public V1alpha3CertificateSpec dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1alpha3CertificateSpec addDnsNamesItem(String dnsNamesItem) { - if (this.dnsNames == null) { - this.dnsNames = new ArrayList(); - } - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. - * - * @return dnsNames - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1alpha3CertificateSpec duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be - * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater - * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of - * the way through the certificate's duration. - * - * @return duration - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public V1alpha3CertificateSpec emailSANs(List emailSANs) { - - this.emailSANs = emailSANs; - return this; - } - - public V1alpha3CertificateSpec addEmailSANsItem(String emailSANsItem) { - if (this.emailSANs == null) { - this.emailSANs = new ArrayList(); - } - this.emailSANs.add(emailSANsItem); - return this; - } - - /** - * EmailSANs is a list of email subjectAltNames to be set on the Certificate. - * - * @return emailSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") - public List getEmailSANs() { - return emailSANs; - } - - public void setEmailSANs(List emailSANs) { - this.emailSANs = emailSANs; - } - - public V1alpha3CertificateSpec ipAddresses(List ipAddresses) { - - this.ipAddresses = ipAddresses; - return this; - } - - public V1alpha3CertificateSpec addIpAddressesItem(String ipAddressesItem) { - if (this.ipAddresses == null) { - this.ipAddresses = new ArrayList(); - } - this.ipAddresses.add(ipAddressesItem); - return this; - } - - /** - * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. - * - * @return ipAddresses - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") - public List getIpAddresses() { - return ipAddresses; - } - - public void setIpAddresses(List ipAddresses) { - this.ipAddresses = ipAddresses; - } - - public V1alpha3CertificateSpec isCA(Boolean isCA) { - - this.isCA = isCA; - return this; - } - - /** - * IsCA will mark this Certificate as valid for certificate signing. This will automatically add - * the `cert sign` usage to the list of `usages`. - * - * @return isCA - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") - public Boolean getIsCA() { - return isCA; - } - - public void setIsCA(Boolean isCA) { - this.isCA = isCA; - } - - public V1alpha3CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1alpha3CertificateSpec keyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - - this.keyAlgorithm = keyAlgorithm; - return this; - } - - /** - * KeyAlgorithm is the private key algorithm of the corresponding private key for this - * certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 - * will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - * - * @return keyAlgorithm - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") - public KeyAlgorithmEnum getKeyAlgorithm() { - return keyAlgorithm; - } - - public void setKeyAlgorithm(KeyAlgorithmEnum keyAlgorithm) { - this.keyAlgorithm = keyAlgorithm; - } - - public V1alpha3CertificateSpec keyEncoding(KeyEncodingEnum keyEncoding) { - - this.keyEncoding = keyEncoding; - return this; - } - - /** - * KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private - * key to be encoded in. If provided, allowed values are \"pkcs1\" and - * \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not - * specified, then PKCS#1 will be used by default. - * - * @return keyEncoding - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not specified, then PKCS#1 will be used by default.") - public KeyEncodingEnum getKeyEncoding() { - return keyEncoding; - } - - public void setKeyEncoding(KeyEncodingEnum keyEncoding) { - this.keyEncoding = keyEncoding; - } - - public V1alpha3CertificateSpec keySize(Integer keySize) { - - this.keySize = keySize; - return this; - } - - /** - * KeySize is the key bit size of the corresponding private key for this certificate. If - * `keyAlgorithm` is set to `RSA`, valid values are `2048`, - * `4096` or `8192`, and will default to `2048` if not specified. If - * `keyAlgorithm` is set to `ECDSA`, valid values are `256`, - * `384` or `521`, and will default to `256` if not specified. No - * other values are allowed. minimum: 0 maximum: 8192 - * - * @return keySize - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "KeySize is the key bit size of the corresponding private key for this certificate. If `keyAlgorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `keyAlgorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") - public Integer getKeySize() { - return keySize; - } - - public void setKeySize(Integer keySize) { - this.keySize = keySize; - } - - public V1alpha3CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { - - this.keystores = keystores; - return this; - } - - /** - * Get keystores - * - * @return keystores - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecKeystores getKeystores() { - return keystores; - } - - public void setKeystores(V1beta1CertificateSpecKeystores keystores) { - this.keystores = keystores; - } - - public V1alpha3CertificateSpec privateKey(V1alpha2CertificateSpecPrivateKey privateKey) { - - this.privateKey = privateKey; - return this; - } - - /** - * Get privateKey - * - * @return privateKey - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2CertificateSpecPrivateKey getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(V1alpha2CertificateSpecPrivateKey privateKey) { - this.privateKey = privateKey; - } - - public V1alpha3CertificateSpec renewBefore(String renewBefore) { - - this.renewBefore = renewBefore; - return this; - } - - /** - * The amount of time before the currently issued certificate's `notAfter` time that - * cert-manager will begin to attempt to renew the certificate. If this value is greater than the - * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed - * 2/3rds of the way through the certificate's duration. - * - * @return renewBefore - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getRenewBefore() { - return renewBefore; - } - - public void setRenewBefore(String renewBefore) { - this.renewBefore = renewBefore; - } - - public V1alpha3CertificateSpec secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * SecretName is the name of the secret resource that will be automatically created and managed by - * this Certificate resource. It will be populated with a private key and certificate, signed by - * the denoted issuer. - * - * @return secretName - */ - @ApiModelProperty( - required = true, - value = - "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") - public String getSecretName() { - return secretName; - } - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - public V1alpha3CertificateSpec subject(V1beta1CertificateSpecSubject subject) { - - this.subject = subject; - return this; - } - - /** - * Get subject - * - * @return subject - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecSubject getSubject() { - return subject; - } - - public void setSubject(V1beta1CertificateSpecSubject subject) { - this.subject = subject; - } - - public V1alpha3CertificateSpec uriSANs(List uriSANs) { - - this.uriSANs = uriSANs; - return this; - } - - public V1alpha3CertificateSpec addUriSANsItem(String uriSANsItem) { - if (this.uriSANs == null) { - this.uriSANs = new ArrayList(); - } - this.uriSANs.add(uriSANsItem); - return this; - } - - /** - * URISANs is a list of URI subjectAltNames to be set on the Certificate. - * - * @return uriSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") - public List getUriSANs() { - return uriSANs; - } - - public void setUriSANs(List uriSANs) { - this.uriSANs = uriSANs; - } - - public V1alpha3CertificateSpec usages(List usages) { - - this.usages = usages; - return this; - } - - public V1alpha3CertificateSpec addUsagesItem(UsagesEnum usagesItem) { - if (this.usages == null) { - this.usages = new ArrayList(); - } - this.usages.add(usagesItem); - return this; - } - - /** - * Usages is the set of x509 usages that are requested for the certificate. Defaults to - * `digital signature` and `key encipherment` if not specified. - * - * @return usages - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") - public List getUsages() { - return usages; - } - - public void setUsages(List usages) { - this.usages = usages; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3CertificateSpec v1alpha3CertificateSpec = (V1alpha3CertificateSpec) o; - return Objects.equals(this.commonName, v1alpha3CertificateSpec.commonName) - && Objects.equals(this.dnsNames, v1alpha3CertificateSpec.dnsNames) - && Objects.equals(this.duration, v1alpha3CertificateSpec.duration) - && Objects.equals(this.emailSANs, v1alpha3CertificateSpec.emailSANs) - && Objects.equals(this.ipAddresses, v1alpha3CertificateSpec.ipAddresses) - && Objects.equals(this.isCA, v1alpha3CertificateSpec.isCA) - && Objects.equals(this.issuerRef, v1alpha3CertificateSpec.issuerRef) - && Objects.equals(this.keyAlgorithm, v1alpha3CertificateSpec.keyAlgorithm) - && Objects.equals(this.keyEncoding, v1alpha3CertificateSpec.keyEncoding) - && Objects.equals(this.keySize, v1alpha3CertificateSpec.keySize) - && Objects.equals(this.keystores, v1alpha3CertificateSpec.keystores) - && Objects.equals(this.privateKey, v1alpha3CertificateSpec.privateKey) - && Objects.equals(this.renewBefore, v1alpha3CertificateSpec.renewBefore) - && Objects.equals(this.secretName, v1alpha3CertificateSpec.secretName) - && Objects.equals(this.subject, v1alpha3CertificateSpec.subject) - && Objects.equals(this.uriSANs, v1alpha3CertificateSpec.uriSANs) - && Objects.equals(this.usages, v1alpha3CertificateSpec.usages); - } - - @Override - public int hashCode() { - return Objects.hash( - commonName, - dnsNames, - duration, - emailSANs, - ipAddresses, - isCA, - issuerRef, - keyAlgorithm, - keyEncoding, - keySize, - keystores, - privateKey, - renewBefore, - secretName, - subject, - uriSANs, - usages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3CertificateSpec {\n"); - sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); - sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); - sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n"); - sb.append(" keyEncoding: ").append(toIndentedString(keyEncoding)).append("\n"); - sb.append(" keySize: ").append(toIndentedString(keySize)).append("\n"); - sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); - sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); - sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); - sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java deleted file mode 100644 index 65748df16a..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Challenge.java +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Challenge is a type to represent a Challenge request with an ACME server */ -@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3Challenge implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3ChallengeSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha3ChallengeStatus status; - - public V1alpha3Challenge apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3Challenge kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3Challenge metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3Challenge spec(V1alpha3ChallengeSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ChallengeSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3ChallengeSpec spec) { - this.spec = spec; - } - - public V1alpha3Challenge status(V1alpha3ChallengeStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ChallengeStatus getStatus() { - return status; - } - - public void setStatus(V1alpha3ChallengeStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3Challenge v1alpha3Challenge = (V1alpha3Challenge) o; - return Objects.equals(this.apiVersion, v1alpha3Challenge.apiVersion) - && Objects.equals(this.kind, v1alpha3Challenge.kind) - && Objects.equals(this.metadata, v1alpha3Challenge.metadata) - && Objects.equals(this.spec, v1alpha3Challenge.spec) - && Objects.equals(this.status, v1alpha3Challenge.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3Challenge {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java deleted file mode 100644 index 3f0c89c6ac..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ChallengeList is a list of Challenge */ -@ApiModel(description = "ChallengeList is a list of Challenge") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ChallengeList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3ChallengeList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3ChallengeList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3ChallengeList addItemsItem(V1alpha3Challenge itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of challenges. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3ChallengeList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3ChallengeList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ChallengeList v1alpha3ChallengeList = (V1alpha3ChallengeList) o; - return Objects.equals(this.apiVersion, v1alpha3ChallengeList.apiVersion) - && Objects.equals(this.items, v1alpha3ChallengeList.items) - && Objects.equals(this.kind, v1alpha3ChallengeList.kind) - && Objects.equals(this.metadata, v1alpha3ChallengeList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ChallengeList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java deleted file mode 100644 index dc29da36ce..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpec.java +++ /dev/null @@ -1,385 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** V1alpha3ChallengeSpec */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ChallengeSpec { - public static final String SERIALIZED_NAME_AUTHZ_U_R_L = "authzURL"; - - @SerializedName(SERIALIZED_NAME_AUTHZ_U_R_L) - private String authzURL; - - public static final String SERIALIZED_NAME_DNS_NAME = "dnsName"; - - @SerializedName(SERIALIZED_NAME_DNS_NAME) - private String dnsName; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1alpha3ChallengeSpecIssuerRef issuerRef; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_SOLVER = "solver"; - - @SerializedName(SERIALIZED_NAME_SOLVER) - private V1alpha3ChallengeSpecSolver solver; - - public static final String SERIALIZED_NAME_TOKEN = "token"; - - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - /** - * Type is the type of ACME challenge this resource represents. One of \"http-01\" or - * \"dns-01\". - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - HTTP_01("http-01"), - - DNS_01("dns-01"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; - - @SerializedName(SERIALIZED_NAME_WILDCARD) - private Boolean wildcard; - - public V1alpha3ChallengeSpec authzURL(String authzURL) { - - this.authzURL = authzURL; - return this; - } - - /** - * AuthzURL is the URL to the ACME Authorization resource that this challenge is a part of. - * - * @return authzURL - */ - @ApiModelProperty( - required = true, - value = - "AuthzURL is the URL to the ACME Authorization resource that this challenge is a part of.") - public String getAuthzURL() { - return authzURL; - } - - public void setAuthzURL(String authzURL) { - this.authzURL = authzURL; - } - - public V1alpha3ChallengeSpec dnsName(String dnsName) { - - this.dnsName = dnsName; - return this; - } - - /** - * DNSName is the identifier that this challenge is for, e.g. example.com. If the requested - * DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for - * `*.example.com`, it must be `example.com`. - * - * @return dnsName - */ - @ApiModelProperty( - required = true, - value = - "DNSName is the identifier that this challenge is for, e.g. example.com. If the requested DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for `*.example.com`, it must be `example.com`.") - public String getDnsName() { - return dnsName; - } - - public void setDnsName(String dnsName) { - this.dnsName = dnsName; - } - - public V1alpha3ChallengeSpec issuerRef(V1alpha3ChallengeSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha3ChallengeSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1alpha3ChallengeSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1alpha3ChallengeSpec key(String key) { - - this.key = key; - return this; - } - - /** - * Key is the ACME challenge key for this challenge For HTTP01 challenges, this is the value that - * must be responded with to complete the HTTP01 challenge in the format: `<private key - * JWK thumbprint>.<key from acme server for challenge>`. For DNS01 challenges, this - * is the base64 encoded SHA256 sum of the `<private key JWK thumbprint>.<key from - * acme server for challenge>` text that must be set as the TXT record content. - * - * @return key - */ - @ApiModelProperty( - required = true, - value = - "Key is the ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be responded with to complete the HTTP01 challenge in the format: `.`. For DNS01 challenges, this is the base64 encoded SHA256 sum of the `.` text that must be set as the TXT record content.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1alpha3ChallengeSpec solver(V1alpha3ChallengeSpecSolver solver) { - - this.solver = solver; - return this; - } - - /** - * Get solver - * - * @return solver - */ - @ApiModelProperty(required = true, value = "") - public V1alpha3ChallengeSpecSolver getSolver() { - return solver; - } - - public void setSolver(V1alpha3ChallengeSpecSolver solver) { - this.solver = solver; - } - - public V1alpha3ChallengeSpec token(String token) { - - this.token = token; - return this; - } - - /** - * Token is the ACME challenge token for this challenge. This is the raw value returned from the - * ACME server. - * - * @return token - */ - @ApiModelProperty( - required = true, - value = - "Token is the ACME challenge token for this challenge. This is the raw value returned from the ACME server.") - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public V1alpha3ChallengeSpec type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Type is the type of ACME challenge this resource represents. One of \"http-01\" or - * \"dns-01\". - * - * @return type - */ - @ApiModelProperty( - required = true, - value = - "Type is the type of ACME challenge this resource represents. One of \"http-01\" or \"dns-01\".") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public V1alpha3ChallengeSpec url(String url) { - - this.url = url; - return this; - } - - /** - * URL is the URL of the ACME Challenge resource for this challenge. This can be used to lookup - * details about the status of this challenge. - * - * @return url - */ - @ApiModelProperty( - required = true, - value = - "URL is the URL of the ACME Challenge resource for this challenge. This can be used to lookup details about the status of this challenge.") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public V1alpha3ChallengeSpec wildcard(Boolean wildcard) { - - this.wildcard = wildcard; - return this; - } - - /** - * Wildcard will be true if this challenge is for a wildcard identifier, for example - * '*.example.com'. - * - * @return wildcard - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Wildcard will be true if this challenge is for a wildcard identifier, for example '*.example.com'.") - public Boolean getWildcard() { - return wildcard; - } - - public void setWildcard(Boolean wildcard) { - this.wildcard = wildcard; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ChallengeSpec v1alpha3ChallengeSpec = (V1alpha3ChallengeSpec) o; - return Objects.equals(this.authzURL, v1alpha3ChallengeSpec.authzURL) - && Objects.equals(this.dnsName, v1alpha3ChallengeSpec.dnsName) - && Objects.equals(this.issuerRef, v1alpha3ChallengeSpec.issuerRef) - && Objects.equals(this.key, v1alpha3ChallengeSpec.key) - && Objects.equals(this.solver, v1alpha3ChallengeSpec.solver) - && Objects.equals(this.token, v1alpha3ChallengeSpec.token) - && Objects.equals(this.type, v1alpha3ChallengeSpec.type) - && Objects.equals(this.url, v1alpha3ChallengeSpec.url) - && Objects.equals(this.wildcard, v1alpha3ChallengeSpec.wildcard); - } - - @Override - public int hashCode() { - return Objects.hash(authzURL, dnsName, issuerRef, key, solver, token, type, url, wildcard); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ChallengeSpec {\n"); - sb.append(" authzURL: ").append(toIndentedString(authzURL)).append("\n"); - sb.append(" dnsName: ").append(toIndentedString(dnsName)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" solver: ").append(toIndentedString(solver)).append("\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java deleted file mode 100644 index 6fa1ce69b2..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecIssuerRef.java +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * IssuerRef references a properly configured ACME-type Issuer which should be used to create this - * Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an - * 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed. - */ -@ApiModel( - description = - "IssuerRef references a properly configured ACME-type Issuer which should be used to create this Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ChallengeSpecIssuerRef { - public static final String SERIALIZED_NAME_GROUP = "group"; - - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1alpha3ChallengeSpecIssuerRef group(String group) { - - this.group = group; - return this; - } - - /** - * Group of the resource being referred to. - * - * @return group - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Group of the resource being referred to.") - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public V1alpha3ChallengeSpecIssuerRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind of the resource being referred to. - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind of the resource being referred to.") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3ChallengeSpecIssuerRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. - * - * @return name - */ - @ApiModelProperty(required = true, value = "Name of the resource being referred to.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ChallengeSpecIssuerRef v1alpha3ChallengeSpecIssuerRef = - (V1alpha3ChallengeSpecIssuerRef) o; - return Objects.equals(this.group, v1alpha3ChallengeSpecIssuerRef.group) - && Objects.equals(this.kind, v1alpha3ChallengeSpecIssuerRef.kind) - && Objects.equals(this.name, v1alpha3ChallengeSpecIssuerRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(group, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ChallengeSpecIssuerRef {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java deleted file mode 100644 index 1a132e09c3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeSpecSolver.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Solver contains the domain solving configuration that should be used to solve this challenge - * resource. - */ -@ApiModel( - description = - "Solver contains the domain solving configuration that should be used to solve this challenge resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ChallengeSpecSolver { - public static final String SERIALIZED_NAME_DNS01 = "dns01"; - - @SerializedName(SERIALIZED_NAME_DNS01) - private V1alpha2IssuerSpecAcmeDns01 dns01; - - public static final String SERIALIZED_NAME_HTTP01 = "http01"; - - @SerializedName(SERIALIZED_NAME_HTTP01) - private V1alpha2IssuerSpecAcmeHttp01 http01; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1alpha2IssuerSpecAcmeSelector selector; - - public V1alpha3ChallengeSpecSolver dns01(V1alpha2IssuerSpecAcmeDns01 dns01) { - - this.dns01 = dns01; - return this; - } - - /** - * Get dns01 - * - * @return dns01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01 getDns01() { - return dns01; - } - - public void setDns01(V1alpha2IssuerSpecAcmeDns01 dns01) { - this.dns01 = dns01; - } - - public V1alpha3ChallengeSpecSolver http01(V1alpha2IssuerSpecAcmeHttp01 http01) { - - this.http01 = http01; - return this; - } - - /** - * Get http01 - * - * @return http01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { - return http01; - } - - public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { - this.http01 = http01; - } - - public V1alpha3ChallengeSpecSolver selector(V1alpha2IssuerSpecAcmeSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * - * @return selector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeSelector getSelector() { - return selector; - } - - public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { - this.selector = selector; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ChallengeSpecSolver v1alpha3ChallengeSpecSolver = (V1alpha3ChallengeSpecSolver) o; - return Objects.equals(this.dns01, v1alpha3ChallengeSpecSolver.dns01) - && Objects.equals(this.http01, v1alpha3ChallengeSpecSolver.http01) - && Objects.equals(this.selector, v1alpha3ChallengeSpecSolver.selector); - } - - @Override - public int hashCode() { - return Objects.hash(dns01, http01, selector); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ChallengeSpecSolver {\n"); - sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); - sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java deleted file mode 100644 index a797c12c5e..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ChallengeStatus.java +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** V1alpha3ChallengeStatus */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ChallengeStatus { - public static final String SERIALIZED_NAME_PRESENTED = "presented"; - - @SerializedName(SERIALIZED_NAME_PRESENTED) - private Boolean presented; - - public static final String SERIALIZED_NAME_PROCESSING = "processing"; - - @SerializedName(SERIALIZED_NAME_PROCESSING) - private Boolean processing; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** - * State contains the current 'state' of the challenge. If not set, the state of the - * challenge is unknown. - */ - @JsonAdapter(StateEnum.Adapter.class) - public enum StateEnum { - VALID("valid"), - - READY("ready"), - - PENDING("pending"), - - PROCESSING("processing"), - - INVALID("invalid"), - - EXPIRED("expired"), - - ERRORED("errored"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StateEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StateEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATE = "state"; - - @SerializedName(SERIALIZED_NAME_STATE) - private StateEnum state; - - public V1alpha3ChallengeStatus presented(Boolean presented) { - - this.presented = presented; - return this; - } - - /** - * Presented will be set to true if the challenge values for this challenge are currently - * 'presented'. This *does not* imply the self check is passing. Only that the values have - * been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has - * been presented, or the HTTP01 configuration has been configured). - * - * @return presented - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Presented will be set to true if the challenge values for this challenge are currently 'presented'. This *does not* imply the self check is passing. Only that the values have been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has been presented, or the HTTP01 configuration has been configured).") - public Boolean getPresented() { - return presented; - } - - public void setPresented(Boolean presented) { - this.presented = presented; - } - - public V1alpha3ChallengeStatus processing(Boolean processing) { - - this.processing = processing; - return this; - } - - /** - * Processing is used to denote whether this challenge should be processed or not. This field will - * only be set to true by the 'scheduling' component. It will only be set to false by the - * 'challenges' controller, after the challenge has reached a final state or timed out. If - * this field is set to false, the challenge controller will not take any more action. - * - * @return processing - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Processing is used to denote whether this challenge should be processed or not. This field will only be set to true by the 'scheduling' component. It will only be set to false by the 'challenges' controller, after the challenge has reached a final state or timed out. If this field is set to false, the challenge controller will not take any more action.") - public Boolean getProcessing() { - return processing; - } - - public void setProcessing(Boolean processing) { - this.processing = processing; - } - - public V1alpha3ChallengeStatus reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason contains human readable information on why the Challenge is in the current state. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Reason contains human readable information on why the Challenge is in the current state.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1alpha3ChallengeStatus state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * State contains the current 'state' of the challenge. If not set, the state of the - * challenge is unknown. - * - * @return state - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "State contains the current 'state' of the challenge. If not set, the state of the challenge is unknown.") - public StateEnum getState() { - return state; - } - - public void setState(StateEnum state) { - this.state = state; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ChallengeStatus v1alpha3ChallengeStatus = (V1alpha3ChallengeStatus) o; - return Objects.equals(this.presented, v1alpha3ChallengeStatus.presented) - && Objects.equals(this.processing, v1alpha3ChallengeStatus.processing) - && Objects.equals(this.reason, v1alpha3ChallengeStatus.reason) - && Objects.equals(this.state, v1alpha3ChallengeStatus.state); - } - - @Override - public int hashCode() { - return Objects.hash(presented, processing, reason, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ChallengeStatus {\n"); - sb.append(" presented: ").append(toIndentedString(presented)).append("\n"); - sb.append(" processing: ").append(toIndentedString(processing)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java deleted file mode 100644 index 7497a5645f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuer.java +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and - * therefore can be referenced by resources that exist in *any* namespace, not just the same - * namespace as the referent. - */ -@ApiModel( - description = - "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3ClusterIssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha3ClusterIssuerStatus status; - - public V1alpha3ClusterIssuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3ClusterIssuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3ClusterIssuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3ClusterIssuer spec(V1alpha3ClusterIssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ClusterIssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3ClusterIssuerSpec spec) { - this.spec = spec; - } - - public V1alpha3ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ClusterIssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha3ClusterIssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ClusterIssuer v1alpha3ClusterIssuer = (V1alpha3ClusterIssuer) o; - return Objects.equals(this.apiVersion, v1alpha3ClusterIssuer.apiVersion) - && Objects.equals(this.kind, v1alpha3ClusterIssuer.kind) - && Objects.equals(this.metadata, v1alpha3ClusterIssuer.metadata) - && Objects.equals(this.spec, v1alpha3ClusterIssuer.spec) - && Objects.equals(this.status, v1alpha3ClusterIssuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ClusterIssuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java deleted file mode 100644 index 5f49755faa..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ClusterIssuerList is a list of ClusterIssuer */ -@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3ClusterIssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3ClusterIssuerList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3ClusterIssuerList addItemsItem(V1alpha3ClusterIssuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of clusterissuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3ClusterIssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3ClusterIssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ClusterIssuerList v1alpha3ClusterIssuerList = (V1alpha3ClusterIssuerList) o; - return Objects.equals(this.apiVersion, v1alpha3ClusterIssuerList.apiVersion) - && Objects.equals(this.items, v1alpha3ClusterIssuerList.items) - && Objects.equals(this.kind, v1alpha3ClusterIssuerList.kind) - && Objects.equals(this.metadata, v1alpha3ClusterIssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ClusterIssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java deleted file mode 100644 index 81ddf2be83..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerSpec.java +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Desired state of the ClusterIssuer resource. */ -@ApiModel(description = "Desired state of the ClusterIssuer resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ClusterIssuerSpec { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1alpha2IssuerSpecAcme acme; - - public static final String SERIALIZED_NAME_CA = "ca"; - - @SerializedName(SERIALIZED_NAME_CA) - private V1alpha2IssuerSpecCa ca; - - public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; - - @SerializedName(SERIALIZED_NAME_SELF_SIGNED) - private V1alpha2IssuerSpecSelfSigned selfSigned; - - public static final String SERIALIZED_NAME_VAULT = "vault"; - - @SerializedName(SERIALIZED_NAME_VAULT) - private V1alpha2IssuerSpecVault vault; - - public static final String SERIALIZED_NAME_VENAFI = "venafi"; - - @SerializedName(SERIALIZED_NAME_VENAFI) - private V1alpha2IssuerSpecVenafi venafi; - - public V1alpha3ClusterIssuerSpec acme(V1alpha2IssuerSpecAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcme getAcme() { - return acme; - } - - public void setAcme(V1alpha2IssuerSpecAcme acme) { - this.acme = acme; - } - - public V1alpha3ClusterIssuerSpec ca(V1alpha2IssuerSpecCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * - * @return ca - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecCa getCa() { - return ca; - } - - public void setCa(V1alpha2IssuerSpecCa ca) { - this.ca = ca; - } - - public V1alpha3ClusterIssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - - this.selfSigned = selfSigned; - return this; - } - - /** - * Get selfSigned - * - * @return selfSigned - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecSelfSigned getSelfSigned() { - return selfSigned; - } - - public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - this.selfSigned = selfSigned; - } - - public V1alpha3ClusterIssuerSpec vault(V1alpha2IssuerSpecVault vault) { - - this.vault = vault; - return this; - } - - /** - * Get vault - * - * @return vault - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVault getVault() { - return vault; - } - - public void setVault(V1alpha2IssuerSpecVault vault) { - this.vault = vault; - } - - public V1alpha3ClusterIssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { - - this.venafi = venafi; - return this; - } - - /** - * Get venafi - * - * @return venafi - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafi getVenafi() { - return venafi; - } - - public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { - this.venafi = venafi; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ClusterIssuerSpec v1alpha3ClusterIssuerSpec = (V1alpha3ClusterIssuerSpec) o; - return Objects.equals(this.acme, v1alpha3ClusterIssuerSpec.acme) - && Objects.equals(this.ca, v1alpha3ClusterIssuerSpec.ca) - && Objects.equals(this.selfSigned, v1alpha3ClusterIssuerSpec.selfSigned) - && Objects.equals(this.vault, v1alpha3ClusterIssuerSpec.vault) - && Objects.equals(this.venafi, v1alpha3ClusterIssuerSpec.venafi); - } - - @Override - public int hashCode() { - return Objects.hash(acme, ca, selfSigned, vault, venafi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ClusterIssuerSpec {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); - sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); - sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java deleted file mode 100644 index cf417e4d0c..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3ClusterIssuerStatus.java +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Status of the ClusterIssuer. This is set and managed automatically. */ -@ApiModel(description = "Status of the ClusterIssuer. This is set and managed automatically.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3ClusterIssuerStatus { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1alpha2IssuerStatusAcme acme; - - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public V1alpha3ClusterIssuerStatus acme(V1alpha2IssuerStatusAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerStatusAcme getAcme() { - return acme; - } - - public void setAcme(V1alpha2IssuerStatusAcme acme) { - this.acme = acme; - } - - public V1alpha3ClusterIssuerStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1alpha3ClusterIssuerStatus addConditionsItem( - V1alpha2IssuerStatusConditions conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * List of status conditions to indicate the status of a CertificateRequest. Known condition types - * are `Ready`. - * - * @return conditions - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready`.") - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3ClusterIssuerStatus v1alpha3ClusterIssuerStatus = (V1alpha3ClusterIssuerStatus) o; - return Objects.equals(this.acme, v1alpha3ClusterIssuerStatus.acme) - && Objects.equals(this.conditions, v1alpha3ClusterIssuerStatus.conditions); - } - - @Override - public int hashCode() { - return Objects.hash(acme, conditions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3ClusterIssuerStatus {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java deleted file mode 100644 index 7bc938fb21..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Issuer.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * An Issuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is scoped to a single namespace and can therefore only be - * referenced by resources within the same namespace. - */ -@ApiModel( - description = - "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3Issuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha2IssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha2IssuerStatus status; - - public V1alpha3Issuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3Issuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3Issuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3Issuer spec(V1alpha2IssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha2IssuerSpec spec) { - this.spec = spec; - } - - public V1alpha3Issuer status(V1alpha2IssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha2IssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3Issuer v1alpha3Issuer = (V1alpha3Issuer) o; - return Objects.equals(this.apiVersion, v1alpha3Issuer.apiVersion) - && Objects.equals(this.kind, v1alpha3Issuer.kind) - && Objects.equals(this.metadata, v1alpha3Issuer.metadata) - && Objects.equals(this.spec, v1alpha3Issuer.spec) - && Objects.equals(this.status, v1alpha3Issuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3Issuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java deleted file mode 100644 index 01574cc4c7..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3IssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** IssuerList is a list of Issuer */ -@ApiModel(description = "IssuerList is a list of Issuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3IssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3IssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3IssuerList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3IssuerList addItemsItem(V1alpha3Issuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of issuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3IssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3IssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3IssuerList v1alpha3IssuerList = (V1alpha3IssuerList) o; - return Objects.equals(this.apiVersion, v1alpha3IssuerList.apiVersion) - && Objects.equals(this.items, v1alpha3IssuerList.items) - && Objects.equals(this.kind, v1alpha3IssuerList.kind) - && Objects.equals(this.metadata, v1alpha3IssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3IssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java deleted file mode 100644 index 13057cc119..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3Order.java +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Order is a type to represent an Order with an ACME server */ -@ApiModel(description = "Order is a type to represent an Order with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3Order implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha3OrderSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1OrderStatus status; - - public V1alpha3Order apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3Order kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3Order metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1alpha3Order spec(V1alpha3OrderSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3OrderSpec getSpec() { - return spec; - } - - public void setSpec(V1alpha3OrderSpec spec) { - this.spec = spec; - } - - public V1alpha3Order status(V1beta1OrderStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1OrderStatus getStatus() { - return status; - } - - public void setStatus(V1beta1OrderStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3Order v1alpha3Order = (V1alpha3Order) o; - return Objects.equals(this.apiVersion, v1alpha3Order.apiVersion) - && Objects.equals(this.kind, v1alpha3Order.kind) - && Objects.equals(this.metadata, v1alpha3Order.metadata) - && Objects.equals(this.spec, v1alpha3Order.spec) - && Objects.equals(this.status, v1alpha3Order.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3Order {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java deleted file mode 100644 index ade3cd9485..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** OrderList is a list of Order */ -@ApiModel(description = "OrderList is a list of Order") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3OrderList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1alpha3OrderList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1alpha3OrderList items(List items) { - - this.items = items; - return this; - } - - public V1alpha3OrderList addItemsItem(V1alpha3Order itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of orders. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1alpha3OrderList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1alpha3OrderList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3OrderList v1alpha3OrderList = (V1alpha3OrderList) o; - return Objects.equals(this.apiVersion, v1alpha3OrderList.apiVersion) - && Objects.equals(this.items, v1alpha3OrderList.items) - && Objects.equals(this.kind, v1alpha3OrderList.kind) - && Objects.equals(this.metadata, v1alpha3OrderList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3OrderList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java deleted file mode 100644 index 18224f1085..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1alpha3OrderSpec.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** V1alpha3OrderSpec */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1alpha3OrderSpec { - public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; - - @SerializedName(SERIALIZED_NAME_COMMON_NAME) - private String commonName; - - public static final String SERIALIZED_NAME_CSR = "csr"; - - @SerializedName(SERIALIZED_NAME_CSR) - private byte[] csr; - - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = new ArrayList(); - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1OrderSpecIssuerRef issuerRef; - - public V1alpha3OrderSpec commonName(String commonName) { - - this.commonName = commonName; - return this; - } - - /** - * CommonName is the common name as specified on the DER encoded CSR. If specified, this value - * must also be present in `dnsNames`. This field must match the corresponding field on - * the DER encoded CSR. - * - * @return commonName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CommonName is the common name as specified on the DER encoded CSR. If specified, this value must also be present in `dnsNames`. This field must match the corresponding field on the DER encoded CSR.") - public String getCommonName() { - return commonName; - } - - public void setCommonName(String commonName) { - this.commonName = commonName; - } - - public V1alpha3OrderSpec csr(byte[] csr) { - - this.csr = csr; - return this; - } - - /** - * Certificate signing request bytes in DER encoding. This will be used when finalizing the order. - * This field must be set on the order. - * - * @return csr - */ - @ApiModelProperty( - required = true, - value = - "Certificate signing request bytes in DER encoding. This will be used when finalizing the order. This field must be set on the order.") - public byte[] getCsr() { - return csr; - } - - public void setCsr(byte[] csr) { - this.csr = csr; - } - - public V1alpha3OrderSpec dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1alpha3OrderSpec addDnsNamesItem(String dnsNamesItem) { - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * DNSNames is a list of DNS names that should be included as part of the Order validation - * process. This field must match the corresponding field on the DER encoded CSR. - * - * @return dnsNames - */ - @ApiModelProperty( - required = true, - value = - "DNSNames is a list of DNS names that should be included as part of the Order validation process. This field must match the corresponding field on the DER encoded CSR.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1alpha3OrderSpec issuerRef(V1beta1OrderSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1OrderSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1OrderSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3OrderSpec v1alpha3OrderSpec = (V1alpha3OrderSpec) o; - return Objects.equals(this.commonName, v1alpha3OrderSpec.commonName) - && Arrays.equals(this.csr, v1alpha3OrderSpec.csr) - && Objects.equals(this.dnsNames, v1alpha3OrderSpec.dnsNames) - && Objects.equals(this.issuerRef, v1alpha3OrderSpec.issuerRef); - } - - @Override - public int hashCode() { - return Objects.hash(commonName, Arrays.hashCode(csr), dnsNames, issuerRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3OrderSpec {\n"); - sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); - sb.append(" csr: ").append(toIndentedString(csr)).append("\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java deleted file mode 100644 index 23cc914f59..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Certificate.java +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A Certificate resource should be created to ensure an up to date and signed x509 certificate is - * stored in the Kubernetes Secret resource named in `spec.secretName`. The stored - * certificate will be renewed before it expires (as configured by `spec.renewBefore`). - */ -@ApiModel( - description = - "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1Certificate implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1CertificateSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateStatus status; - - public V1beta1Certificate apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1Certificate kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1Certificate metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1Certificate spec(V1beta1CertificateSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1CertificateSpec spec) { - this.spec = spec; - } - - public V1beta1Certificate status(V1beta1CertificateStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1Certificate v1beta1Certificate = (V1beta1Certificate) o; - return Objects.equals(this.apiVersion, v1beta1Certificate.apiVersion) - && Objects.equals(this.kind, v1beta1Certificate.kind) - && Objects.equals(this.metadata, v1beta1Certificate.metadata) - && Objects.equals(this.spec, v1beta1Certificate.spec) - && Objects.equals(this.status, v1beta1Certificate.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1Certificate {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java deleted file mode 100644 index 6f080a3e8f..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateList is a list of Certificate */ -@ApiModel(description = "CertificateList is a list of Certificate") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1CertificateList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1CertificateList items(List items) { - - this.items = items; - return this; - } - - public V1beta1CertificateList addItemsItem(V1beta1Certificate itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificates. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1CertificateList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1CertificateList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateList v1beta1CertificateList = (V1beta1CertificateList) o; - return Objects.equals(this.apiVersion, v1beta1CertificateList.apiVersion) - && Objects.equals(this.items, v1beta1CertificateList.items) - && Objects.equals(this.kind, v1beta1CertificateList.kind) - && Objects.equals(this.metadata, v1beta1CertificateList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java deleted file mode 100644 index 6bbb8dd564..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequest.java +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A CertificateRequest is used to request a signed certificate from one of the configured issuers. - * All fields within the CertificateRequest's `spec` are immutable after creation. A - * CertificateRequest will either succeed or fail, as denoted by its `status.state` field. - * A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in - * time request for a certificate and cannot be re-used. - */ -@ApiModel( - description = - "A CertificateRequest is used to request a signed certificate from one of the configured issuers. All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field. A CertificateRequest is a 'one-shot' resource, meaning it represents a single point in time request for a certificate and cannot be re-used.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequest implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1CertificateRequestSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1CertificateRequestStatus status; - - public V1beta1CertificateRequest apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1CertificateRequest kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1CertificateRequest metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1CertificateRequest spec(V1beta1CertificateRequestSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateRequestSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1CertificateRequestSpec spec) { - this.spec = spec; - } - - public V1beta1CertificateRequest status(V1beta1CertificateRequestStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateRequestStatus getStatus() { - return status; - } - - public void setStatus(V1beta1CertificateRequestStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequest v1beta1CertificateRequest = (V1beta1CertificateRequest) o; - return Objects.equals(this.apiVersion, v1beta1CertificateRequest.apiVersion) - && Objects.equals(this.kind, v1beta1CertificateRequest.kind) - && Objects.equals(this.metadata, v1beta1CertificateRequest.metadata) - && Objects.equals(this.spec, v1beta1CertificateRequest.spec) - && Objects.equals(this.status, v1beta1CertificateRequest.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequest {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java deleted file mode 100644 index f98d537f46..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestList.java +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** CertificateRequestList is a list of CertificateRequest */ -@ApiModel(description = "CertificateRequestList is a list of CertificateRequest") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequestList - implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1CertificateRequestList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1CertificateRequestList items(List items) { - - this.items = items; - return this; - } - - public V1beta1CertificateRequestList addItemsItem(V1beta1CertificateRequest itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of certificaterequests. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of certificaterequests. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1CertificateRequestList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1CertificateRequestList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequestList v1beta1CertificateRequestList = (V1beta1CertificateRequestList) o; - return Objects.equals(this.apiVersion, v1beta1CertificateRequestList.apiVersion) - && Objects.equals(this.items, v1beta1CertificateRequestList.items) - && Objects.equals(this.kind, v1beta1CertificateRequestList.kind) - && Objects.equals(this.metadata, v1beta1CertificateRequestList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequestList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java deleted file mode 100644 index f5cbe79cf3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpec.java +++ /dev/null @@ -1,326 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** Desired state of the CertificateRequest resource. */ -@ApiModel(description = "Desired state of the CertificateRequest resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequestSpec { - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_IS_C_A = "isCA"; - - @SerializedName(SERIALIZED_NAME_IS_C_A) - private Boolean isCA; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1CertificateRequestSpecIssuerRef issuerRef; - - public static final String SERIALIZED_NAME_REQUEST = "request"; - - @SerializedName(SERIALIZED_NAME_REQUEST) - private byte[] request; - - /** - * KeyUsage specifies valid usage contexts for keys. See: - * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: - * \"signing\", \"digital signature\", \"content commitment\", - * \"key encipherment\", \"key agreement\", \"data encipherment\", - * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher - * only\", \"any\", \"server auth\", \"client auth\", - * \"code signing\", \"email protection\", \"s/mime\", \"ipsec - * end system\", \"ipsec tunnel\", \"ipsec user\", - * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", - * \"netscape sgc\" - */ - @JsonAdapter(UsagesEnum.Adapter.class) - public enum UsagesEnum { - SIGNING("signing"), - - DIGITAL_SIGNATURE("digital signature"), - - CONTENT_COMMITMENT("content commitment"), - - KEY_ENCIPHERMENT("key encipherment"), - - KEY_AGREEMENT("key agreement"), - - DATA_ENCIPHERMENT("data encipherment"), - - CERT_SIGN("cert sign"), - - CRL_SIGN("crl sign"), - - ENCIPHER_ONLY("encipher only"), - - DECIPHER_ONLY("decipher only"), - - ANY("any"), - - SERVER_AUTH("server auth"), - - CLIENT_AUTH("client auth"), - - CODE_SIGNING("code signing"), - - EMAIL_PROTECTION("email protection"), - - S_MIME("s/mime"), - - IPSEC_END_SYSTEM("ipsec end system"), - - IPSEC_TUNNEL("ipsec tunnel"), - - IPSEC_USER("ipsec user"), - - TIMESTAMPING("timestamping"), - - OCSP_SIGNING("ocsp signing"), - - MICROSOFT_SGC("microsoft sgc"), - - NETSCAPE_SGC("netscape sgc"); - - private String value; - - UsagesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UsagesEnum fromValue(String value) { - for (UsagesEnum b : UsagesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UsagesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UsagesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_USAGES = "usages"; - - @SerializedName(SERIALIZED_NAME_USAGES) - private List usages = null; - - public V1beta1CertificateRequestSpec duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be - * ignored/overridden by some issuer types. - * - * @return duration - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types.") - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public V1beta1CertificateRequestSpec isCA(Boolean isCA) { - - this.isCA = isCA; - return this; - } - - /** - * IsCA will request to mark the certificate as valid for certificate signing when submitting to - * the issuer. This will automatically add the `cert sign` usage to the list of - * `usages`. - * - * @return isCA - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "IsCA will request to mark the certificate as valid for certificate signing when submitting to the issuer. This will automatically add the `cert sign` usage to the list of `usages`.") - public Boolean getIsCA() { - return isCA; - } - - public void setIsCA(Boolean isCA) { - this.isCA = isCA; - } - - public V1beta1CertificateRequestSpec issuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateRequestSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1CertificateRequestSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1beta1CertificateRequestSpec request(byte[] request) { - - this.request = request; - return this; - } - - /** - * The PEM-encoded x509 certificate signing request to be submitted to the CA for signing. - * - * @return request - */ - @ApiModelProperty( - required = true, - value = - "The PEM-encoded x509 certificate signing request to be submitted to the CA for signing.") - public byte[] getRequest() { - return request; - } - - public void setRequest(byte[] request) { - this.request = request; - } - - public V1beta1CertificateRequestSpec usages(List usages) { - - this.usages = usages; - return this; - } - - public V1beta1CertificateRequestSpec addUsagesItem(UsagesEnum usagesItem) { - if (this.usages == null) { - this.usages = new ArrayList(); - } - this.usages.add(usagesItem); - return this; - } - - /** - * Usages is the set of x509 usages that are requested for the certificate. Defaults to - * `digital signature` and `key encipherment` if not specified. - * - * @return usages - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") - public List getUsages() { - return usages; - } - - public void setUsages(List usages) { - this.usages = usages; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequestSpec v1beta1CertificateRequestSpec = (V1beta1CertificateRequestSpec) o; - return Objects.equals(this.duration, v1beta1CertificateRequestSpec.duration) - && Objects.equals(this.isCA, v1beta1CertificateRequestSpec.isCA) - && Objects.equals(this.issuerRef, v1beta1CertificateRequestSpec.issuerRef) - && Arrays.equals(this.request, v1beta1CertificateRequestSpec.request) - && Objects.equals(this.usages, v1beta1CertificateRequestSpec.usages); - } - - @Override - public int hashCode() { - return Objects.hash(duration, isCA, issuerRef, Arrays.hashCode(request), usages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequestSpec {\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" request: ").append(toIndentedString(request)).append("\n"); - sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java deleted file mode 100644 index 7c0ca58791..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestSpecIssuerRef.java +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * IssuerRef is a reference to the issuer for this CertificateRequest. If the 'kind' field - * is not set, or set to 'Issuer', an Issuer resource with the given name in the same - * namespace as the CertificateRequest will be used. If the 'kind' field is set to - * 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' - * field in this stanza is required at all times. The group field refers to the API group of the - * issuer which defaults to 'cert-manager.io' if empty. - */ -@ApiModel( - description = - "IssuerRef is a reference to the issuer for this CertificateRequest. If the 'kind' field is not set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as the CertificateRequest will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' field in this stanza is required at all times. The group field refers to the API group of the issuer which defaults to 'cert-manager.io' if empty.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequestSpecIssuerRef { - public static final String SERIALIZED_NAME_GROUP = "group"; - - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1CertificateRequestSpecIssuerRef group(String group) { - - this.group = group; - return this; - } - - /** - * Group of the resource being referred to. - * - * @return group - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Group of the resource being referred to.") - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public V1beta1CertificateRequestSpecIssuerRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind of the resource being referred to. - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind of the resource being referred to.") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1CertificateRequestSpecIssuerRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. - * - * @return name - */ - @ApiModelProperty(required = true, value = "Name of the resource being referred to.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequestSpecIssuerRef v1beta1CertificateRequestSpecIssuerRef = - (V1beta1CertificateRequestSpecIssuerRef) o; - return Objects.equals(this.group, v1beta1CertificateRequestSpecIssuerRef.group) - && Objects.equals(this.kind, v1beta1CertificateRequestSpecIssuerRef.kind) - && Objects.equals(this.name, v1beta1CertificateRequestSpecIssuerRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(group, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequestSpecIssuerRef {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java deleted file mode 100644 index ef1d7006a5..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatus.java +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** Status of the CertificateRequest. This is set and managed automatically. */ -@ApiModel(description = "Status of the CertificateRequest. This is set and managed automatically.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequestStatus { - public static final String SERIALIZED_NAME_CA = "ca"; - - @SerializedName(SERIALIZED_NAME_CA) - private byte[] ca; - - public static final String SERIALIZED_NAME_CERTIFICATE = "certificate"; - - @SerializedName(SERIALIZED_NAME_CERTIFICATE) - private byte[] certificate; - - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public static final String SERIALIZED_NAME_FAILURE_TIME = "failureTime"; - - @SerializedName(SERIALIZED_NAME_FAILURE_TIME) - private OffsetDateTime failureTime; - - public V1beta1CertificateRequestStatus ca(byte[] ca) { - - this.ca = ca; - return this; - } - - /** - * The PEM encoded x509 certificate of the signer, also known as the CA (Certificate Authority). - * This is set on a best-effort basis by different issuers. If not set, the CA is assumed to be - * unknown/not available. - * - * @return ca - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The PEM encoded x509 certificate of the signer, also known as the CA (Certificate Authority). This is set on a best-effort basis by different issuers. If not set, the CA is assumed to be unknown/not available.") - public byte[] getCa() { - return ca; - } - - public void setCa(byte[] ca) { - this.ca = ca; - } - - public V1beta1CertificateRequestStatus certificate(byte[] certificate) { - - this.certificate = certificate; - return this; - } - - /** - * The PEM encoded x509 certificate resulting from the certificate signing request. If not set, - * the CertificateRequest has either not been completed or has failed. More information on failure - * can be found by checking the `conditions` field. - * - * @return certificate - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The PEM encoded x509 certificate resulting from the certificate signing request. If not set, the CertificateRequest has either not been completed or has failed. More information on failure can be found by checking the `conditions` field.") - public byte[] getCertificate() { - return certificate; - } - - public void setCertificate(byte[] certificate) { - this.certificate = certificate; - } - - public V1beta1CertificateRequestStatus conditions( - List conditions) { - - this.conditions = conditions; - return this; - } - - public V1beta1CertificateRequestStatus addConditionsItem( - V1beta1CertificateRequestStatusConditions conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * List of status conditions to indicate the status of a CertificateRequest. Known condition types - * are `Ready` and `InvalidRequest`. - * - * @return conditions - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of status conditions to indicate the status of a CertificateRequest. Known condition types are `Ready` and `InvalidRequest`.") - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public V1beta1CertificateRequestStatus failureTime(OffsetDateTime failureTime) { - - this.failureTime = failureTime; - return this; - } - - /** - * FailureTime stores the time that this CertificateRequest failed. This is used to influence - * garbage collection and back-off. - * - * @return failureTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "FailureTime stores the time that this CertificateRequest failed. This is used to influence garbage collection and back-off.") - public OffsetDateTime getFailureTime() { - return failureTime; - } - - public void setFailureTime(OffsetDateTime failureTime) { - this.failureTime = failureTime; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequestStatus v1beta1CertificateRequestStatus = - (V1beta1CertificateRequestStatus) o; - return Arrays.equals(this.ca, v1beta1CertificateRequestStatus.ca) - && Arrays.equals(this.certificate, v1beta1CertificateRequestStatus.certificate) - && Objects.equals(this.conditions, v1beta1CertificateRequestStatus.conditions) - && Objects.equals(this.failureTime, v1beta1CertificateRequestStatus.failureTime); - } - - @Override - public int hashCode() { - return Objects.hash(Arrays.hashCode(ca), Arrays.hashCode(certificate), conditions, failureTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequestStatus {\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" failureTime: ").append(toIndentedString(failureTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java deleted file mode 100644 index 7811ef5b65..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateRequestStatusConditions.java +++ /dev/null @@ -1,266 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -/** CertificateRequestCondition contains condition information for a CertificateRequest. */ -@ApiModel( - description = - "CertificateRequestCondition contains condition information for a CertificateRequest.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateRequestStatusConditions { - public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; - - @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) - private OffsetDateTime lastTransitionTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** Status of the condition, one of ('True', 'False', 'Unknown'). */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - TRUE("True"), - - FALSE("False"), - - UNKNOWN("Unknown"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1beta1CertificateRequestStatusConditions lastTransitionTime( - OffsetDateTime lastTransitionTime) { - - this.lastTransitionTime = lastTransitionTime; - return this; - } - - /** - * LastTransitionTime is the timestamp corresponding to the last status change of this condition. - * - * @return lastTransitionTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") - public OffsetDateTime getLastTransitionTime() { - return lastTransitionTime; - } - - public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { - this.lastTransitionTime = lastTransitionTime; - } - - public V1beta1CertificateRequestStatusConditions message(String message) { - - this.message = message; - return this; - } - - /** - * Message is a human readable description of the details of the last transition, complementing - * reason. - * - * @return message - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Message is a human readable description of the details of the last transition, complementing reason.") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public V1beta1CertificateRequestStatusConditions reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason is a brief machine readable explanation for the condition's last transition. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Reason is a brief machine readable explanation for the condition's last transition.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1beta1CertificateRequestStatusConditions status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status of the condition, one of ('True', 'False', 'Unknown'). - * - * @return status - */ - @ApiModelProperty( - required = true, - value = "Status of the condition, one of ('True', 'False', 'Unknown').") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public V1beta1CertificateRequestStatusConditions type(String type) { - - this.type = type; - return this; - } - - /** - * Type of the condition, known values are ('Ready', 'InvalidRequest'). - * - * @return type - */ - @ApiModelProperty( - required = true, - value = "Type of the condition, known values are ('Ready', 'InvalidRequest').") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateRequestStatusConditions v1beta1CertificateRequestStatusConditions = - (V1beta1CertificateRequestStatusConditions) o; - return Objects.equals( - this.lastTransitionTime, v1beta1CertificateRequestStatusConditions.lastTransitionTime) - && Objects.equals(this.message, v1beta1CertificateRequestStatusConditions.message) - && Objects.equals(this.reason, v1beta1CertificateRequestStatusConditions.reason) - && Objects.equals(this.status, v1beta1CertificateRequestStatusConditions.status) - && Objects.equals(this.type, v1beta1CertificateRequestStatusConditions.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastTransitionTime, message, reason, status, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateRequestStatusConditions {\n"); - sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java deleted file mode 100644 index 581c319456..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpec.java +++ /dev/null @@ -1,640 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Desired state of the Certificate resource. */ -@ApiModel(description = "Desired state of the Certificate resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpec { - public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; - - @SerializedName(SERIALIZED_NAME_COMMON_NAME) - private String commonName; - - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = null; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_EMAIL_S_A_NS = "emailSANs"; - - @SerializedName(SERIALIZED_NAME_EMAIL_S_A_NS) - private List emailSANs = null; - - public static final String SERIALIZED_NAME_IP_ADDRESSES = "ipAddresses"; - - @SerializedName(SERIALIZED_NAME_IP_ADDRESSES) - private List ipAddresses = null; - - public static final String SERIALIZED_NAME_IS_C_A = "isCA"; - - @SerializedName(SERIALIZED_NAME_IS_C_A) - private Boolean isCA; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1CertificateSpecIssuerRef issuerRef; - - public static final String SERIALIZED_NAME_KEYSTORES = "keystores"; - - @SerializedName(SERIALIZED_NAME_KEYSTORES) - private V1beta1CertificateSpecKeystores keystores; - - public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; - - @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) - private V1beta1CertificateSpecPrivateKey privateKey; - - public static final String SERIALIZED_NAME_RENEW_BEFORE = "renewBefore"; - - @SerializedName(SERIALIZED_NAME_RENEW_BEFORE) - private String renewBefore; - - public static final String SERIALIZED_NAME_SECRET_NAME = "secretName"; - - @SerializedName(SERIALIZED_NAME_SECRET_NAME) - private String secretName; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - - @SerializedName(SERIALIZED_NAME_SUBJECT) - private V1beta1CertificateSpecSubject subject; - - public static final String SERIALIZED_NAME_URI_S_A_NS = "uriSANs"; - - @SerializedName(SERIALIZED_NAME_URI_S_A_NS) - private List uriSANs = null; - - /** - * KeyUsage specifies valid usage contexts for keys. See: - * https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - * https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: - * \"signing\", \"digital signature\", \"content commitment\", - * \"key encipherment\", \"key agreement\", \"data encipherment\", - * \"cert sign\", \"crl sign\", \"encipher only\", \"decipher - * only\", \"any\", \"server auth\", \"client auth\", - * \"code signing\", \"email protection\", \"s/mime\", \"ipsec - * end system\", \"ipsec tunnel\", \"ipsec user\", - * \"timestamping\", \"ocsp signing\", \"microsoft sgc\", - * \"netscape sgc\" - */ - @JsonAdapter(UsagesEnum.Adapter.class) - public enum UsagesEnum { - SIGNING("signing"), - - DIGITAL_SIGNATURE("digital signature"), - - CONTENT_COMMITMENT("content commitment"), - - KEY_ENCIPHERMENT("key encipherment"), - - KEY_AGREEMENT("key agreement"), - - DATA_ENCIPHERMENT("data encipherment"), - - CERT_SIGN("cert sign"), - - CRL_SIGN("crl sign"), - - ENCIPHER_ONLY("encipher only"), - - DECIPHER_ONLY("decipher only"), - - ANY("any"), - - SERVER_AUTH("server auth"), - - CLIENT_AUTH("client auth"), - - CODE_SIGNING("code signing"), - - EMAIL_PROTECTION("email protection"), - - S_MIME("s/mime"), - - IPSEC_END_SYSTEM("ipsec end system"), - - IPSEC_TUNNEL("ipsec tunnel"), - - IPSEC_USER("ipsec user"), - - TIMESTAMPING("timestamping"), - - OCSP_SIGNING("ocsp signing"), - - MICROSOFT_SGC("microsoft sgc"), - - NETSCAPE_SGC("netscape sgc"); - - private String value; - - UsagesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UsagesEnum fromValue(String value) { - for (UsagesEnum b : UsagesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UsagesEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UsagesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UsagesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_USAGES = "usages"; - - @SerializedName(SERIALIZED_NAME_USAGES) - private List usages = null; - - public V1beta1CertificateSpec commonName(String commonName) { - - this.commonName = commonName; - return this; - } - - /** - * CommonName is a common name to be used on the Certificate. The CommonName should have a length - * of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS - * clients when any subject alt name is set. This is x509 behaviour: - * https://tools.ietf.org/html/rfc6125#section-6.4.4 - * - * @return commonName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4") - public String getCommonName() { - return commonName; - } - - public void setCommonName(String commonName) { - this.commonName = commonName; - } - - public V1beta1CertificateSpec dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1beta1CertificateSpec addDnsNamesItem(String dnsNamesItem) { - if (this.dnsNames == null) { - this.dnsNames = new ArrayList(); - } - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * DNSNames is a list of DNS subjectAltNames to be set on the Certificate. - * - * @return dnsNames - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "DNSNames is a list of DNS subjectAltNames to be set on the Certificate.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1beta1CertificateSpec duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * The requested 'duration' (i.e. lifetime) of the Certificate. This option may be - * ignored/overridden by some issuer types. If overridden and `renewBefore` is greater - * than the actual certificate duration, the certificate will be automatically renewed 2/3rds of - * the way through the certificate's duration. - * - * @return duration - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public V1beta1CertificateSpec emailSANs(List emailSANs) { - - this.emailSANs = emailSANs; - return this; - } - - public V1beta1CertificateSpec addEmailSANsItem(String emailSANsItem) { - if (this.emailSANs == null) { - this.emailSANs = new ArrayList(); - } - this.emailSANs.add(emailSANsItem); - return this; - } - - /** - * EmailSANs is a list of email subjectAltNames to be set on the Certificate. - * - * @return emailSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "EmailSANs is a list of email subjectAltNames to be set on the Certificate.") - public List getEmailSANs() { - return emailSANs; - } - - public void setEmailSANs(List emailSANs) { - this.emailSANs = emailSANs; - } - - public V1beta1CertificateSpec ipAddresses(List ipAddresses) { - - this.ipAddresses = ipAddresses; - return this; - } - - public V1beta1CertificateSpec addIpAddressesItem(String ipAddressesItem) { - if (this.ipAddresses == null) { - this.ipAddresses = new ArrayList(); - } - this.ipAddresses.add(ipAddressesItem); - return this; - } - - /** - * IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. - * - * @return ipAddresses - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "IPAddresses is a list of IP address subjectAltNames to be set on the Certificate.") - public List getIpAddresses() { - return ipAddresses; - } - - public void setIpAddresses(List ipAddresses) { - this.ipAddresses = ipAddresses; - } - - public V1beta1CertificateSpec isCA(Boolean isCA) { - - this.isCA = isCA; - return this; - } - - /** - * IsCA will mark this Certificate as valid for certificate signing. This will automatically add - * the `cert sign` usage to the list of `usages`. - * - * @return isCA - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.") - public Boolean getIsCA() { - return isCA; - } - - public void setIsCA(Boolean isCA) { - this.isCA = isCA; - } - - public V1beta1CertificateSpec issuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1CertificateSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1beta1CertificateSpec keystores(V1beta1CertificateSpecKeystores keystores) { - - this.keystores = keystores; - return this; - } - - /** - * Get keystores - * - * @return keystores - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecKeystores getKeystores() { - return keystores; - } - - public void setKeystores(V1beta1CertificateSpecKeystores keystores) { - this.keystores = keystores; - } - - public V1beta1CertificateSpec privateKey(V1beta1CertificateSpecPrivateKey privateKey) { - - this.privateKey = privateKey; - return this; - } - - /** - * Get privateKey - * - * @return privateKey - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecPrivateKey getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(V1beta1CertificateSpecPrivateKey privateKey) { - this.privateKey = privateKey; - } - - public V1beta1CertificateSpec renewBefore(String renewBefore) { - - this.renewBefore = renewBefore; - return this; - } - - /** - * The amount of time before the currently issued certificate's `notAfter` time that - * cert-manager will begin to attempt to renew the certificate. If this value is greater than the - * total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed - * 2/3rds of the way through the certificate's duration. - * - * @return renewBefore - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.") - public String getRenewBefore() { - return renewBefore; - } - - public void setRenewBefore(String renewBefore) { - this.renewBefore = renewBefore; - } - - public V1beta1CertificateSpec secretName(String secretName) { - - this.secretName = secretName; - return this; - } - - /** - * SecretName is the name of the secret resource that will be automatically created and managed by - * this Certificate resource. It will be populated with a private key and certificate, signed by - * the denoted issuer. - * - * @return secretName - */ - @ApiModelProperty( - required = true, - value = - "SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.") - public String getSecretName() { - return secretName; - } - - public void setSecretName(String secretName) { - this.secretName = secretName; - } - - public V1beta1CertificateSpec subject(V1beta1CertificateSpecSubject subject) { - - this.subject = subject; - return this; - } - - /** - * Get subject - * - * @return subject - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecSubject getSubject() { - return subject; - } - - public void setSubject(V1beta1CertificateSpecSubject subject) { - this.subject = subject; - } - - public V1beta1CertificateSpec uriSANs(List uriSANs) { - - this.uriSANs = uriSANs; - return this; - } - - public V1beta1CertificateSpec addUriSANsItem(String uriSANsItem) { - if (this.uriSANs == null) { - this.uriSANs = new ArrayList(); - } - this.uriSANs.add(uriSANsItem); - return this; - } - - /** - * URISANs is a list of URI subjectAltNames to be set on the Certificate. - * - * @return uriSANs - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "URISANs is a list of URI subjectAltNames to be set on the Certificate.") - public List getUriSANs() { - return uriSANs; - } - - public void setUriSANs(List uriSANs) { - this.uriSANs = uriSANs; - } - - public V1beta1CertificateSpec usages(List usages) { - - this.usages = usages; - return this; - } - - public V1beta1CertificateSpec addUsagesItem(UsagesEnum usagesItem) { - if (this.usages == null) { - this.usages = new ArrayList(); - } - this.usages.add(usagesItem); - return this; - } - - /** - * Usages is the set of x509 usages that are requested for the certificate. Defaults to - * `digital signature` and `key encipherment` if not specified. - * - * @return usages - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified.") - public List getUsages() { - return usages; - } - - public void setUsages(List usages) { - this.usages = usages; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpec v1beta1CertificateSpec = (V1beta1CertificateSpec) o; - return Objects.equals(this.commonName, v1beta1CertificateSpec.commonName) - && Objects.equals(this.dnsNames, v1beta1CertificateSpec.dnsNames) - && Objects.equals(this.duration, v1beta1CertificateSpec.duration) - && Objects.equals(this.emailSANs, v1beta1CertificateSpec.emailSANs) - && Objects.equals(this.ipAddresses, v1beta1CertificateSpec.ipAddresses) - && Objects.equals(this.isCA, v1beta1CertificateSpec.isCA) - && Objects.equals(this.issuerRef, v1beta1CertificateSpec.issuerRef) - && Objects.equals(this.keystores, v1beta1CertificateSpec.keystores) - && Objects.equals(this.privateKey, v1beta1CertificateSpec.privateKey) - && Objects.equals(this.renewBefore, v1beta1CertificateSpec.renewBefore) - && Objects.equals(this.secretName, v1beta1CertificateSpec.secretName) - && Objects.equals(this.subject, v1beta1CertificateSpec.subject) - && Objects.equals(this.uriSANs, v1beta1CertificateSpec.uriSANs) - && Objects.equals(this.usages, v1beta1CertificateSpec.usages); - } - - @Override - public int hashCode() { - return Objects.hash( - commonName, - dnsNames, - duration, - emailSANs, - ipAddresses, - isCA, - issuerRef, - keystores, - privateKey, - renewBefore, - secretName, - subject, - uriSANs, - usages); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpec {\n"); - sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" emailSANs: ").append(toIndentedString(emailSANs)).append("\n"); - sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n"); - sb.append(" isCA: ").append(toIndentedString(isCA)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" keystores: ").append(toIndentedString(keystores)).append("\n"); - sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); - sb.append(" renewBefore: ").append(toIndentedString(renewBefore)).append("\n"); - sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" uriSANs: ").append(toIndentedString(uriSANs)).append("\n"); - sb.append(" usages: ").append(toIndentedString(usages)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java deleted file mode 100644 index 6a0a1ee6d9..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecIssuerRef.java +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * IssuerRef is a reference to the issuer for this certificate. If the 'kind' field is not - * set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as - * the Certificate will be used. If the 'kind' field is set to 'ClusterIssuer', a - * ClusterIssuer with the provided name will be used. The 'name' field in this stanza is - * required at all times. - */ -@ApiModel( - description = - "IssuerRef is a reference to the issuer for this certificate. If the 'kind' field is not set, or set to 'Issuer', an Issuer resource with the given name in the same namespace as the Certificate will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer with the provided name will be used. The 'name' field in this stanza is required at all times.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecIssuerRef { - public static final String SERIALIZED_NAME_GROUP = "group"; - - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1CertificateSpecIssuerRef group(String group) { - - this.group = group; - return this; - } - - /** - * Group of the resource being referred to. - * - * @return group - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Group of the resource being referred to.") - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public V1beta1CertificateSpecIssuerRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind of the resource being referred to. - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind of the resource being referred to.") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1CertificateSpecIssuerRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. - * - * @return name - */ - @ApiModelProperty(required = true, value = "Name of the resource being referred to.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecIssuerRef v1beta1CertificateSpecIssuerRef = - (V1beta1CertificateSpecIssuerRef) o; - return Objects.equals(this.group, v1beta1CertificateSpecIssuerRef.group) - && Objects.equals(this.kind, v1beta1CertificateSpecIssuerRef.kind) - && Objects.equals(this.name, v1beta1CertificateSpecIssuerRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(group, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecIssuerRef {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java deleted file mode 100644 index 5e6e4170f4..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystores.java +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Keystores configures additional keystore output formats stored in the `secretName` - * Secret resource. - */ -@ApiModel( - description = - "Keystores configures additional keystore output formats stored in the `secretName` Secret resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecKeystores { - public static final String SERIALIZED_NAME_JKS = "jks"; - - @SerializedName(SERIALIZED_NAME_JKS) - private V1beta1CertificateSpecKeystoresJks jks; - - public static final String SERIALIZED_NAME_PKCS12 = "pkcs12"; - - @SerializedName(SERIALIZED_NAME_PKCS12) - private V1beta1CertificateSpecKeystoresPkcs12 pkcs12; - - public V1beta1CertificateSpecKeystores jks(V1beta1CertificateSpecKeystoresJks jks) { - - this.jks = jks; - return this; - } - - /** - * Get jks - * - * @return jks - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecKeystoresJks getJks() { - return jks; - } - - public void setJks(V1beta1CertificateSpecKeystoresJks jks) { - this.jks = jks; - } - - public V1beta1CertificateSpecKeystores pkcs12(V1beta1CertificateSpecKeystoresPkcs12 pkcs12) { - - this.pkcs12 = pkcs12; - return this; - } - - /** - * Get pkcs12 - * - * @return pkcs12 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1CertificateSpecKeystoresPkcs12 getPkcs12() { - return pkcs12; - } - - public void setPkcs12(V1beta1CertificateSpecKeystoresPkcs12 pkcs12) { - this.pkcs12 = pkcs12; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecKeystores v1beta1CertificateSpecKeystores = - (V1beta1CertificateSpecKeystores) o; - return Objects.equals(this.jks, v1beta1CertificateSpecKeystores.jks) - && Objects.equals(this.pkcs12, v1beta1CertificateSpecKeystores.pkcs12); - } - - @Override - public int hashCode() { - return Objects.hash(jks, pkcs12); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecKeystores {\n"); - sb.append(" jks: ").append(toIndentedString(jks)).append("\n"); - sb.append(" pkcs12: ").append(toIndentedString(pkcs12)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java deleted file mode 100644 index 0e53673f86..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJks.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * JKS configures options for storing a JKS keystore in the `spec.secretName` Secret - * resource. - */ -@ApiModel( - description = - "JKS configures options for storing a JKS keystore in the `spec.secretName` Secret resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecKeystoresJks { - public static final String SERIALIZED_NAME_CREATE = "create"; - - @SerializedName(SERIALIZED_NAME_CREATE) - private Boolean create; - - public static final String SERIALIZED_NAME_PASSWORD_SECRET_REF = "passwordSecretRef"; - - @SerializedName(SERIALIZED_NAME_PASSWORD_SECRET_REF) - private V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef; - - public V1beta1CertificateSpecKeystoresJks create(Boolean create) { - - this.create = create; - return this; - } - - /** - * Create enables JKS keystore creation for the Certificate. If true, a file named - * `keystore.jks` will be created in the target Secret resource, encrypted using the - * password stored in `passwordSecretRef`. The keystore file will only be updated upon - * re-issuance. - * - * @return create - */ - @ApiModelProperty( - required = true, - value = - "Create enables JKS keystore creation for the Certificate. If true, a file named `keystore.jks` will be created in the target Secret resource, encrypted using the password stored in `passwordSecretRef`. The keystore file will only be updated upon re-issuance.") - public Boolean getCreate() { - return create; - } - - public void setCreate(Boolean create) { - this.create = create; - } - - public V1beta1CertificateSpecKeystoresJks passwordSecretRef( - V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef) { - - this.passwordSecretRef = passwordSecretRef; - return this; - } - - /** - * Get passwordSecretRef - * - * @return passwordSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpecKeystoresJksPasswordSecretRef getPasswordSecretRef() { - return passwordSecretRef; - } - - public void setPasswordSecretRef( - V1beta1CertificateSpecKeystoresJksPasswordSecretRef passwordSecretRef) { - this.passwordSecretRef = passwordSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecKeystoresJks v1beta1CertificateSpecKeystoresJks = - (V1beta1CertificateSpecKeystoresJks) o; - return Objects.equals(this.create, v1beta1CertificateSpecKeystoresJks.create) - && Objects.equals( - this.passwordSecretRef, v1beta1CertificateSpecKeystoresJks.passwordSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(create, passwordSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecKeystoresJks {\n"); - sb.append(" create: ").append(toIndentedString(create)).append("\n"); - sb.append(" passwordSecretRef: ").append(toIndentedString(passwordSecretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java deleted file mode 100644 index 38d56de8c9..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresJksPasswordSecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * PasswordSecretRef is a reference to a key in a Secret resource containing the password used to - * encrypt the JKS keystore. - */ -@ApiModel( - description = - "PasswordSecretRef is a reference to a key in a Secret resource containing the password used to encrypt the JKS keystore.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecKeystoresJksPasswordSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1CertificateSpecKeystoresJksPasswordSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1beta1CertificateSpecKeystoresJksPasswordSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecKeystoresJksPasswordSecretRef - v1beta1CertificateSpecKeystoresJksPasswordSecretRef = - (V1beta1CertificateSpecKeystoresJksPasswordSecretRef) o; - return Objects.equals(this.key, v1beta1CertificateSpecKeystoresJksPasswordSecretRef.key) - && Objects.equals(this.name, v1beta1CertificateSpecKeystoresJksPasswordSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecKeystoresJksPasswordSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java deleted file mode 100644 index 31af898a58..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * PKCS12 configures options for storing a PKCS12 keystore in the `spec.secretName` Secret - * resource. - */ -@ApiModel( - description = - "PKCS12 configures options for storing a PKCS12 keystore in the `spec.secretName` Secret resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecKeystoresPkcs12 { - public static final String SERIALIZED_NAME_CREATE = "create"; - - @SerializedName(SERIALIZED_NAME_CREATE) - private Boolean create; - - public static final String SERIALIZED_NAME_PASSWORD_SECRET_REF = "passwordSecretRef"; - - @SerializedName(SERIALIZED_NAME_PASSWORD_SECRET_REF) - private V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef; - - public V1beta1CertificateSpecKeystoresPkcs12 create(Boolean create) { - - this.create = create; - return this; - } - - /** - * Create enables PKCS12 keystore creation for the Certificate. If true, a file named - * `keystore.p12` will be created in the target Secret resource, encrypted using the - * password stored in `passwordSecretRef`. The keystore file will only be updated upon - * re-issuance. - * - * @return create - */ - @ApiModelProperty( - required = true, - value = - "Create enables PKCS12 keystore creation for the Certificate. If true, a file named `keystore.p12` will be created in the target Secret resource, encrypted using the password stored in `passwordSecretRef`. The keystore file will only be updated upon re-issuance.") - public Boolean getCreate() { - return create; - } - - public void setCreate(Boolean create) { - this.create = create; - } - - public V1beta1CertificateSpecKeystoresPkcs12 passwordSecretRef( - V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef) { - - this.passwordSecretRef = passwordSecretRef; - return this; - } - - /** - * Get passwordSecretRef - * - * @return passwordSecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef getPasswordSecretRef() { - return passwordSecretRef; - } - - public void setPasswordSecretRef( - V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef passwordSecretRef) { - this.passwordSecretRef = passwordSecretRef; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecKeystoresPkcs12 v1beta1CertificateSpecKeystoresPkcs12 = - (V1beta1CertificateSpecKeystoresPkcs12) o; - return Objects.equals(this.create, v1beta1CertificateSpecKeystoresPkcs12.create) - && Objects.equals( - this.passwordSecretRef, v1beta1CertificateSpecKeystoresPkcs12.passwordSecretRef); - } - - @Override - public int hashCode() { - return Objects.hash(create, passwordSecretRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecKeystoresPkcs12 {\n"); - sb.append(" create: ").append(toIndentedString(create)).append("\n"); - sb.append(" passwordSecretRef: ").append(toIndentedString(passwordSecretRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java deleted file mode 100644 index 5a1b17bf30..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * PasswordSecretRef is a reference to a key in a Secret resource containing the password used to - * encrypt the PKCS12 keystore. - */ -@ApiModel( - description = - "PasswordSecretRef is a reference to a key in a Secret resource containing the password used to encrypt the PKCS12 keystore.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef key(String key) { - - this.key = key; - return this; - } - - /** - * The key of the entry in the Secret resource's `data` field to be used. Some - * instances of this field may be defaulted, in others it may be required. - * - * @return key - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. More info: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - * - * @return name - */ - @ApiModelProperty( - required = true, - value = - "Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef - v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef = - (V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef) o; - return Objects.equals(this.key, v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.key) - && Objects.equals(this.name, v1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(key, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecKeystoresPkcs12PasswordSecretRef {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java deleted file mode 100644 index dce8b53538..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecPrivateKey.java +++ /dev/null @@ -1,303 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** Options to control private keys used for the Certificate. */ -@ApiModel(description = "Options to control private keys used for the Certificate.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecPrivateKey { - /** - * Algorithm is the private key algorithm of the corresponding private key for this certificate. - * If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `algorithm` is specified and `size` is not provided, key size of 256 will - * be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - */ - @JsonAdapter(AlgorithmEnum.Adapter.class) - public enum AlgorithmEnum { - RSA("RSA"), - - ECDSA("ECDSA"); - - private String value; - - AlgorithmEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AlgorithmEnum fromValue(String value) { - for (AlgorithmEnum b : AlgorithmEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AlgorithmEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AlgorithmEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AlgorithmEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; - - @SerializedName(SERIALIZED_NAME_ALGORITHM) - private AlgorithmEnum algorithm; - - /** - * The private key cryptography standards (PKCS) encoding for this certificate's private key - * to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" - * standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified. - */ - @JsonAdapter(EncodingEnum.Adapter.class) - public enum EncodingEnum { - PKCS1("PKCS1"), - - PKCS8("PKCS8"); - - private String value; - - EncodingEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EncodingEnum fromValue(String value) { - for (EncodingEnum b : EncodingEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EncodingEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EncodingEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EncodingEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENCODING = "encoding"; - - @SerializedName(SERIALIZED_NAME_ENCODING) - private EncodingEnum encoding; - - public static final String SERIALIZED_NAME_ROTATION_POLICY = "rotationPolicy"; - - @SerializedName(SERIALIZED_NAME_ROTATION_POLICY) - private String rotationPolicy; - - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private Integer size; - - public V1beta1CertificateSpecPrivateKey algorithm(AlgorithmEnum algorithm) { - - this.algorithm = algorithm; - return this; - } - - /** - * Algorithm is the private key algorithm of the corresponding private key for this certificate. - * If provided, allowed values are either \"rsa\" or \"ecdsa\" If - * `algorithm` is specified and `size` is not provided, key size of 256 will - * be used for \"ecdsa\" key algorithm and key size of 2048 will be used for - * \"rsa\" key algorithm. - * - * @return algorithm - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either \"rsa\" or \"ecdsa\" If `algorithm` is specified and `size` is not provided, key size of 256 will be used for \"ecdsa\" key algorithm and key size of 2048 will be used for \"rsa\" key algorithm.") - public AlgorithmEnum getAlgorithm() { - return algorithm; - } - - public void setAlgorithm(AlgorithmEnum algorithm) { - this.algorithm = algorithm; - } - - public V1beta1CertificateSpecPrivateKey encoding(EncodingEnum encoding) { - - this.encoding = encoding; - return this; - } - - /** - * The private key cryptography standards (PKCS) encoding for this certificate's private key - * to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" - * standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified. - * - * @return encoding - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are \"pkcs1\" and \"pkcs8\" standing for PKCS#1 and PKCS#8, respectively. Defaults to PKCS#1 if not specified.") - public EncodingEnum getEncoding() { - return encoding; - } - - public void setEncoding(EncodingEnum encoding) { - this.encoding = encoding; - } - - public V1beta1CertificateSpecPrivateKey rotationPolicy(String rotationPolicy) { - - this.rotationPolicy = rotationPolicy; - return this; - } - - /** - * RotationPolicy controls how private keys should be regenerated when a re-issuance is being - * processed. If set to Never, a private key will only be generated if one does not already exist - * in the target `spec.secretName`. If one does exists but it does not have the correct - * algorithm or size, a warning will be raised to await user intervention. If set to Always, a - * private key matching the specified requirements will be generated whenever a re-issuance - * occurs. Default is 'Never' for backward compatibility. - * - * @return rotationPolicy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility.") - public String getRotationPolicy() { - return rotationPolicy; - } - - public void setRotationPolicy(String rotationPolicy) { - this.rotationPolicy = rotationPolicy; - } - - public V1beta1CertificateSpecPrivateKey size(Integer size) { - - this.size = size; - return this; - } - - /** - * Size is the key bit size of the corresponding private key for this certificate. If - * `algorithm` is set to `RSA`, valid values are `2048`, - * `4096` or `8192`, and will default to `2048` if not specified. If - * `algorithm` is set to `ECDSA`, valid values are `256`, - * `384` or `521`, and will default to `256` if not specified. No - * other values are allowed. minimum: 0 maximum: 8192 - * - * @return size - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.") - public Integer getSize() { - return size; - } - - public void setSize(Integer size) { - this.size = size; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecPrivateKey v1beta1CertificateSpecPrivateKey = - (V1beta1CertificateSpecPrivateKey) o; - return Objects.equals(this.algorithm, v1beta1CertificateSpecPrivateKey.algorithm) - && Objects.equals(this.encoding, v1beta1CertificateSpecPrivateKey.encoding) - && Objects.equals(this.rotationPolicy, v1beta1CertificateSpecPrivateKey.rotationPolicy) - && Objects.equals(this.size, v1beta1CertificateSpecPrivateKey.size); - } - - @Override - public int hashCode() { - return Objects.hash(algorithm, encoding, rotationPolicy, size); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecPrivateKey {\n"); - sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); - sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); - sb.append(" rotationPolicy: ").append(toIndentedString(rotationPolicy)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java deleted file mode 100644 index 56a2bc0369..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateSpecSubject.java +++ /dev/null @@ -1,353 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). */ -@ApiModel( - description = "Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name).") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateSpecSubject { - public static final String SERIALIZED_NAME_COUNTRIES = "countries"; - - @SerializedName(SERIALIZED_NAME_COUNTRIES) - private List countries = null; - - public static final String SERIALIZED_NAME_LOCALITIES = "localities"; - - @SerializedName(SERIALIZED_NAME_LOCALITIES) - private List localities = null; - - public static final String SERIALIZED_NAME_ORGANIZATIONAL_UNITS = "organizationalUnits"; - - @SerializedName(SERIALIZED_NAME_ORGANIZATIONAL_UNITS) - private List organizationalUnits = null; - - public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; - - @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) - private List organizations = null; - - public static final String SERIALIZED_NAME_POSTAL_CODES = "postalCodes"; - - @SerializedName(SERIALIZED_NAME_POSTAL_CODES) - private List postalCodes = null; - - public static final String SERIALIZED_NAME_PROVINCES = "provinces"; - - @SerializedName(SERIALIZED_NAME_PROVINCES) - private List provinces = null; - - public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serialNumber"; - - @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) - private String serialNumber; - - public static final String SERIALIZED_NAME_STREET_ADDRESSES = "streetAddresses"; - - @SerializedName(SERIALIZED_NAME_STREET_ADDRESSES) - private List streetAddresses = null; - - public V1beta1CertificateSpecSubject countries(List countries) { - - this.countries = countries; - return this; - } - - public V1beta1CertificateSpecSubject addCountriesItem(String countriesItem) { - if (this.countries == null) { - this.countries = new ArrayList(); - } - this.countries.add(countriesItem); - return this; - } - - /** - * Countries to be used on the Certificate. - * - * @return countries - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Countries to be used on the Certificate.") - public List getCountries() { - return countries; - } - - public void setCountries(List countries) { - this.countries = countries; - } - - public V1beta1CertificateSpecSubject localities(List localities) { - - this.localities = localities; - return this; - } - - public V1beta1CertificateSpecSubject addLocalitiesItem(String localitiesItem) { - if (this.localities == null) { - this.localities = new ArrayList(); - } - this.localities.add(localitiesItem); - return this; - } - - /** - * Cities to be used on the Certificate. - * - * @return localities - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Cities to be used on the Certificate.") - public List getLocalities() { - return localities; - } - - public void setLocalities(List localities) { - this.localities = localities; - } - - public V1beta1CertificateSpecSubject organizationalUnits(List organizationalUnits) { - - this.organizationalUnits = organizationalUnits; - return this; - } - - public V1beta1CertificateSpecSubject addOrganizationalUnitsItem(String organizationalUnitsItem) { - if (this.organizationalUnits == null) { - this.organizationalUnits = new ArrayList(); - } - this.organizationalUnits.add(organizationalUnitsItem); - return this; - } - - /** - * Organizational Units to be used on the Certificate. - * - * @return organizationalUnits - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Organizational Units to be used on the Certificate.") - public List getOrganizationalUnits() { - return organizationalUnits; - } - - public void setOrganizationalUnits(List organizationalUnits) { - this.organizationalUnits = organizationalUnits; - } - - public V1beta1CertificateSpecSubject organizations(List organizations) { - - this.organizations = organizations; - return this; - } - - public V1beta1CertificateSpecSubject addOrganizationsItem(String organizationsItem) { - if (this.organizations == null) { - this.organizations = new ArrayList(); - } - this.organizations.add(organizationsItem); - return this; - } - - /** - * Organizations to be used on the Certificate. - * - * @return organizations - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Organizations to be used on the Certificate.") - public List getOrganizations() { - return organizations; - } - - public void setOrganizations(List organizations) { - this.organizations = organizations; - } - - public V1beta1CertificateSpecSubject postalCodes(List postalCodes) { - - this.postalCodes = postalCodes; - return this; - } - - public V1beta1CertificateSpecSubject addPostalCodesItem(String postalCodesItem) { - if (this.postalCodes == null) { - this.postalCodes = new ArrayList(); - } - this.postalCodes.add(postalCodesItem); - return this; - } - - /** - * Postal codes to be used on the Certificate. - * - * @return postalCodes - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Postal codes to be used on the Certificate.") - public List getPostalCodes() { - return postalCodes; - } - - public void setPostalCodes(List postalCodes) { - this.postalCodes = postalCodes; - } - - public V1beta1CertificateSpecSubject provinces(List provinces) { - - this.provinces = provinces; - return this; - } - - public V1beta1CertificateSpecSubject addProvincesItem(String provincesItem) { - if (this.provinces == null) { - this.provinces = new ArrayList(); - } - this.provinces.add(provincesItem); - return this; - } - - /** - * State/Provinces to be used on the Certificate. - * - * @return provinces - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "State/Provinces to be used on the Certificate.") - public List getProvinces() { - return provinces; - } - - public void setProvinces(List provinces) { - this.provinces = provinces; - } - - public V1beta1CertificateSpecSubject serialNumber(String serialNumber) { - - this.serialNumber = serialNumber; - return this; - } - - /** - * Serial number to be used on the Certificate. - * - * @return serialNumber - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Serial number to be used on the Certificate.") - public String getSerialNumber() { - return serialNumber; - } - - public void setSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - } - - public V1beta1CertificateSpecSubject streetAddresses(List streetAddresses) { - - this.streetAddresses = streetAddresses; - return this; - } - - public V1beta1CertificateSpecSubject addStreetAddressesItem(String streetAddressesItem) { - if (this.streetAddresses == null) { - this.streetAddresses = new ArrayList(); - } - this.streetAddresses.add(streetAddressesItem); - return this; - } - - /** - * Street addresses to be used on the Certificate. - * - * @return streetAddresses - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Street addresses to be used on the Certificate.") - public List getStreetAddresses() { - return streetAddresses; - } - - public void setStreetAddresses(List streetAddresses) { - this.streetAddresses = streetAddresses; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateSpecSubject v1beta1CertificateSpecSubject = (V1beta1CertificateSpecSubject) o; - return Objects.equals(this.countries, v1beta1CertificateSpecSubject.countries) - && Objects.equals(this.localities, v1beta1CertificateSpecSubject.localities) - && Objects.equals( - this.organizationalUnits, v1beta1CertificateSpecSubject.organizationalUnits) - && Objects.equals(this.organizations, v1beta1CertificateSpecSubject.organizations) - && Objects.equals(this.postalCodes, v1beta1CertificateSpecSubject.postalCodes) - && Objects.equals(this.provinces, v1beta1CertificateSpecSubject.provinces) - && Objects.equals(this.serialNumber, v1beta1CertificateSpecSubject.serialNumber) - && Objects.equals(this.streetAddresses, v1beta1CertificateSpecSubject.streetAddresses); - } - - @Override - public int hashCode() { - return Objects.hash( - countries, - localities, - organizationalUnits, - organizations, - postalCodes, - provinces, - serialNumber, - streetAddresses); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateSpecSubject {\n"); - sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); - sb.append(" localities: ").append(toIndentedString(localities)).append("\n"); - sb.append(" organizationalUnits: ") - .append(toIndentedString(organizationalUnits)) - .append("\n"); - sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); - sb.append(" postalCodes: ").append(toIndentedString(postalCodes)).append("\n"); - sb.append(" provinces: ").append(toIndentedString(provinces)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" streetAddresses: ").append(toIndentedString(streetAddresses)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java deleted file mode 100644 index ae83e0aa81..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatus.java +++ /dev/null @@ -1,308 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Status of the Certificate. This is set and managed automatically. */ -@ApiModel(description = "Status of the Certificate. This is set and managed automatically.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateStatus { - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public static final String SERIALIZED_NAME_LAST_FAILURE_TIME = "lastFailureTime"; - - @SerializedName(SERIALIZED_NAME_LAST_FAILURE_TIME) - private OffsetDateTime lastFailureTime; - - public static final String SERIALIZED_NAME_NEXT_PRIVATE_KEY_SECRET_NAME = - "nextPrivateKeySecretName"; - - @SerializedName(SERIALIZED_NAME_NEXT_PRIVATE_KEY_SECRET_NAME) - private String nextPrivateKeySecretName; - - public static final String SERIALIZED_NAME_NOT_AFTER = "notAfter"; - - @SerializedName(SERIALIZED_NAME_NOT_AFTER) - private OffsetDateTime notAfter; - - public static final String SERIALIZED_NAME_NOT_BEFORE = "notBefore"; - - @SerializedName(SERIALIZED_NAME_NOT_BEFORE) - private OffsetDateTime notBefore; - - public static final String SERIALIZED_NAME_RENEWAL_TIME = "renewalTime"; - - @SerializedName(SERIALIZED_NAME_RENEWAL_TIME) - private OffsetDateTime renewalTime; - - public static final String SERIALIZED_NAME_REVISION = "revision"; - - @SerializedName(SERIALIZED_NAME_REVISION) - private Integer revision; - - public V1beta1CertificateStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1beta1CertificateStatus addConditionsItem( - V1beta1CertificateStatusConditions conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * List of status conditions to indicate the status of certificates. Known condition types are - * `Ready` and `Issuing`. - * - * @return conditions - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`.") - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public V1beta1CertificateStatus lastFailureTime(OffsetDateTime lastFailureTime) { - - this.lastFailureTime = lastFailureTime; - return this; - } - - /** - * LastFailureTime is the time as recorded by the Certificate controller of the most recent - * failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager - * will not re-request another Certificate until 1 hour has elapsed from this time. - * - * @return lastFailureTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time.") - public OffsetDateTime getLastFailureTime() { - return lastFailureTime; - } - - public void setLastFailureTime(OffsetDateTime lastFailureTime) { - this.lastFailureTime = lastFailureTime; - } - - public V1beta1CertificateStatus nextPrivateKeySecretName(String nextPrivateKeySecretName) { - - this.nextPrivateKeySecretName = nextPrivateKeySecretName; - return this; - } - - /** - * The name of the Secret resource containing the private key to be used for the next certificate - * iteration. The keymanager controller will automatically set this field if the - * `Issuing` condition is set to `True`. It will automatically unset this - * field when the Issuing condition is not set or False. - * - * @return nextPrivateKeySecretName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of the Secret resource containing the private key to be used for the next certificate iteration. The keymanager controller will automatically set this field if the `Issuing` condition is set to `True`. It will automatically unset this field when the Issuing condition is not set or False.") - public String getNextPrivateKeySecretName() { - return nextPrivateKeySecretName; - } - - public void setNextPrivateKeySecretName(String nextPrivateKeySecretName) { - this.nextPrivateKeySecretName = nextPrivateKeySecretName; - } - - public V1beta1CertificateStatus notAfter(OffsetDateTime notAfter) { - - this.notAfter = notAfter; - return this; - } - - /** - * The expiration time of the certificate stored in the secret named by this resource in - * `spec.secretName`. - * - * @return notAfter - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`.") - public OffsetDateTime getNotAfter() { - return notAfter; - } - - public void setNotAfter(OffsetDateTime notAfter) { - this.notAfter = notAfter; - } - - public V1beta1CertificateStatus notBefore(OffsetDateTime notBefore) { - - this.notBefore = notBefore; - return this; - } - - /** - * The time after which the certificate stored in the secret named by this resource in - * spec.secretName is valid. - * - * @return notBefore - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The time after which the certificate stored in the secret named by this resource in spec.secretName is valid.") - public OffsetDateTime getNotBefore() { - return notBefore; - } - - public void setNotBefore(OffsetDateTime notBefore) { - this.notBefore = notBefore; - } - - public V1beta1CertificateStatus renewalTime(OffsetDateTime renewalTime) { - - this.renewalTime = renewalTime; - return this; - } - - /** - * RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming - * renewal is scheduled. - * - * @return renewalTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled.") - public OffsetDateTime getRenewalTime() { - return renewalTime; - } - - public void setRenewalTime(OffsetDateTime renewalTime) { - this.renewalTime = renewalTime; - } - - public V1beta1CertificateStatus revision(Integer revision) { - - this.revision = revision; - return this; - } - - /** - * The current 'revision' of the certificate as issued. When a CertificateRequest resource - * is created, it will have the `cert-manager.io/certificate-revision` set to one - * greater than the current value of this field. Upon issuance, this field will be set to the - * value of the annotation on the CertificateRequest resource used to issue the certificate. - * Persisting the value on the CertificateRequest resource allows the certificates controller to - * know whether a request is part of an old issuance or if it is part of the ongoing - * revision's issuance by checking if the revision value in the annotation is greater than - * this field. - * - * @return revision - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The current 'revision' of the certificate as issued. When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` set to one greater than the current value of this field. Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource used to issue the certificate. Persisting the value on the CertificateRequest resource allows the certificates controller to know whether a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking if the revision value in the annotation is greater than this field.") - public Integer getRevision() { - return revision; - } - - public void setRevision(Integer revision) { - this.revision = revision; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateStatus v1beta1CertificateStatus = (V1beta1CertificateStatus) o; - return Objects.equals(this.conditions, v1beta1CertificateStatus.conditions) - && Objects.equals(this.lastFailureTime, v1beta1CertificateStatus.lastFailureTime) - && Objects.equals( - this.nextPrivateKeySecretName, v1beta1CertificateStatus.nextPrivateKeySecretName) - && Objects.equals(this.notAfter, v1beta1CertificateStatus.notAfter) - && Objects.equals(this.notBefore, v1beta1CertificateStatus.notBefore) - && Objects.equals(this.renewalTime, v1beta1CertificateStatus.renewalTime) - && Objects.equals(this.revision, v1beta1CertificateStatus.revision); - } - - @Override - public int hashCode() { - return Objects.hash( - conditions, - lastFailureTime, - nextPrivateKeySecretName, - notAfter, - notBefore, - renewalTime, - revision); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateStatus {\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" lastFailureTime: ").append(toIndentedString(lastFailureTime)).append("\n"); - sb.append(" nextPrivateKeySecretName: ") - .append(toIndentedString(nextPrivateKeySecretName)) - .append("\n"); - sb.append(" notAfter: ").append(toIndentedString(notAfter)).append("\n"); - sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); - sb.append(" renewalTime: ").append(toIndentedString(renewalTime)).append("\n"); - sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java deleted file mode 100644 index 539c169227..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1CertificateStatusConditions.java +++ /dev/null @@ -1,263 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -/** CertificateCondition contains condition information for an Certificate. */ -@ApiModel(description = "CertificateCondition contains condition information for an Certificate.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1CertificateStatusConditions { - public static final String SERIALIZED_NAME_LAST_TRANSITION_TIME = "lastTransitionTime"; - - @SerializedName(SERIALIZED_NAME_LAST_TRANSITION_TIME) - private OffsetDateTime lastTransitionTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** Status of the condition, one of ('True', 'False', 'Unknown'). */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - TRUE("True"), - - FALSE("False"), - - UNKNOWN("Unknown"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public V1beta1CertificateStatusConditions lastTransitionTime(OffsetDateTime lastTransitionTime) { - - this.lastTransitionTime = lastTransitionTime; - return this; - } - - /** - * LastTransitionTime is the timestamp corresponding to the last status change of this condition. - * - * @return lastTransitionTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "LastTransitionTime is the timestamp corresponding to the last status change of this condition.") - public OffsetDateTime getLastTransitionTime() { - return lastTransitionTime; - } - - public void setLastTransitionTime(OffsetDateTime lastTransitionTime) { - this.lastTransitionTime = lastTransitionTime; - } - - public V1beta1CertificateStatusConditions message(String message) { - - this.message = message; - return this; - } - - /** - * Message is a human readable description of the details of the last transition, complementing - * reason. - * - * @return message - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Message is a human readable description of the details of the last transition, complementing reason.") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public V1beta1CertificateStatusConditions reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason is a brief machine readable explanation for the condition's last transition. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Reason is a brief machine readable explanation for the condition's last transition.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1beta1CertificateStatusConditions status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status of the condition, one of ('True', 'False', 'Unknown'). - * - * @return status - */ - @ApiModelProperty( - required = true, - value = "Status of the condition, one of ('True', 'False', 'Unknown').") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public V1beta1CertificateStatusConditions type(String type) { - - this.type = type; - return this; - } - - /** - * Type of the condition, known values are ('Ready', `Issuing`). - * - * @return type - */ - @ApiModelProperty( - required = true, - value = "Type of the condition, known values are ('Ready', `Issuing`).") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1CertificateStatusConditions v1beta1CertificateStatusConditions = - (V1beta1CertificateStatusConditions) o; - return Objects.equals( - this.lastTransitionTime, v1beta1CertificateStatusConditions.lastTransitionTime) - && Objects.equals(this.message, v1beta1CertificateStatusConditions.message) - && Objects.equals(this.reason, v1beta1CertificateStatusConditions.reason) - && Objects.equals(this.status, v1beta1CertificateStatusConditions.status) - && Objects.equals(this.type, v1beta1CertificateStatusConditions.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastTransitionTime, message, reason, status, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1CertificateStatusConditions {\n"); - sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java deleted file mode 100644 index 2fa64e1db0..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Challenge.java +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Challenge is a type to represent a Challenge request with an ACME server */ -@ApiModel(description = "Challenge is a type to represent a Challenge request with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1Challenge implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1ChallengeSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1ChallengeStatus status; - - public V1beta1Challenge apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1Challenge kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1Challenge metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1Challenge spec(V1beta1ChallengeSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1ChallengeSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1ChallengeSpec spec) { - this.spec = spec; - } - - public V1beta1Challenge status(V1beta1ChallengeStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1ChallengeStatus getStatus() { - return status; - } - - public void setStatus(V1beta1ChallengeStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1Challenge v1beta1Challenge = (V1beta1Challenge) o; - return Objects.equals(this.apiVersion, v1beta1Challenge.apiVersion) - && Objects.equals(this.kind, v1beta1Challenge.kind) - && Objects.equals(this.metadata, v1beta1Challenge.metadata) - && Objects.equals(this.spec, v1beta1Challenge.spec) - && Objects.equals(this.status, v1beta1Challenge.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1Challenge {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java deleted file mode 100644 index ff0d9a04e9..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ChallengeList is a list of Challenge */ -@ApiModel(description = "ChallengeList is a list of Challenge") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1ChallengeList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1ChallengeList items(List items) { - - this.items = items; - return this; - } - - public V1beta1ChallengeList addItemsItem(V1beta1Challenge itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of challenges. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of challenges. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1ChallengeList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1ChallengeList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeList v1beta1ChallengeList = (V1beta1ChallengeList) o; - return Objects.equals(this.apiVersion, v1beta1ChallengeList.apiVersion) - && Objects.equals(this.items, v1beta1ChallengeList.items) - && Objects.equals(this.kind, v1beta1ChallengeList.kind) - && Objects.equals(this.metadata, v1beta1ChallengeList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java deleted file mode 100644 index 419d07497c..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpec.java +++ /dev/null @@ -1,385 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** V1beta1ChallengeSpec */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeSpec { - public static final String SERIALIZED_NAME_AUTHORIZATION_U_R_L = "authorizationURL"; - - @SerializedName(SERIALIZED_NAME_AUTHORIZATION_U_R_L) - private String authorizationURL; - - public static final String SERIALIZED_NAME_DNS_NAME = "dnsName"; - - @SerializedName(SERIALIZED_NAME_DNS_NAME) - private String dnsName; - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1ChallengeSpecIssuerRef issuerRef; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_SOLVER = "solver"; - - @SerializedName(SERIALIZED_NAME_SOLVER) - private V1beta1ChallengeSpecSolver solver; - - public static final String SERIALIZED_NAME_TOKEN = "token"; - - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - /** - * The type of ACME challenge this resource represents. One of \"HTTP-01\" or - * \"DNS-01\". - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - HTTP_01("HTTP-01"), - - DNS_01("DNS-01"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; - - @SerializedName(SERIALIZED_NAME_WILDCARD) - private Boolean wildcard; - - public V1beta1ChallengeSpec authorizationURL(String authorizationURL) { - - this.authorizationURL = authorizationURL; - return this; - } - - /** - * The URL to the ACME Authorization resource that this challenge is a part of. - * - * @return authorizationURL - */ - @ApiModelProperty( - required = true, - value = "The URL to the ACME Authorization resource that this challenge is a part of.") - public String getAuthorizationURL() { - return authorizationURL; - } - - public void setAuthorizationURL(String authorizationURL) { - this.authorizationURL = authorizationURL; - } - - public V1beta1ChallengeSpec dnsName(String dnsName) { - - this.dnsName = dnsName; - return this; - } - - /** - * dnsName is the identifier that this challenge is for, e.g. example.com. If the requested - * DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for - * `*.example.com`, it must be `example.com`. - * - * @return dnsName - */ - @ApiModelProperty( - required = true, - value = - "dnsName is the identifier that this challenge is for, e.g. example.com. If the requested DNSName is a 'wildcard', this field MUST be set to the non-wildcard domain, e.g. for `*.example.com`, it must be `example.com`.") - public String getDnsName() { - return dnsName; - } - - public void setDnsName(String dnsName) { - this.dnsName = dnsName; - } - - public V1beta1ChallengeSpec issuerRef(V1beta1ChallengeSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1ChallengeSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1ChallengeSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1beta1ChallengeSpec key(String key) { - - this.key = key; - return this; - } - - /** - * The ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be - * responded with to complete the HTTP01 challenge in the format: `<private key JWK - * thumbprint>.<key from acme server for challenge>`. For DNS01 challenges, this is - * the base64 encoded SHA256 sum of the `<private key JWK thumbprint>.<key from acme - * server for challenge>` text that must be set as the TXT record content. - * - * @return key - */ - @ApiModelProperty( - required = true, - value = - "The ACME challenge key for this challenge For HTTP01 challenges, this is the value that must be responded with to complete the HTTP01 challenge in the format: `.`. For DNS01 challenges, this is the base64 encoded SHA256 sum of the `.` text that must be set as the TXT record content.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public V1beta1ChallengeSpec solver(V1beta1ChallengeSpecSolver solver) { - - this.solver = solver; - return this; - } - - /** - * Get solver - * - * @return solver - */ - @ApiModelProperty(required = true, value = "") - public V1beta1ChallengeSpecSolver getSolver() { - return solver; - } - - public void setSolver(V1beta1ChallengeSpecSolver solver) { - this.solver = solver; - } - - public V1beta1ChallengeSpec token(String token) { - - this.token = token; - return this; - } - - /** - * The ACME challenge token for this challenge. This is the raw value returned from the ACME - * server. - * - * @return token - */ - @ApiModelProperty( - required = true, - value = - "The ACME challenge token for this challenge. This is the raw value returned from the ACME server.") - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public V1beta1ChallengeSpec type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The type of ACME challenge this resource represents. One of \"HTTP-01\" or - * \"DNS-01\". - * - * @return type - */ - @ApiModelProperty( - required = true, - value = - "The type of ACME challenge this resource represents. One of \"HTTP-01\" or \"DNS-01\".") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public V1beta1ChallengeSpec url(String url) { - - this.url = url; - return this; - } - - /** - * The URL of the ACME Challenge resource for this challenge. This can be used to lookup details - * about the status of this challenge. - * - * @return url - */ - @ApiModelProperty( - required = true, - value = - "The URL of the ACME Challenge resource for this challenge. This can be used to lookup details about the status of this challenge.") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public V1beta1ChallengeSpec wildcard(Boolean wildcard) { - - this.wildcard = wildcard; - return this; - } - - /** - * wildcard will be true if this challenge is for a wildcard identifier, for example - * '*.example.com'. - * - * @return wildcard - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "wildcard will be true if this challenge is for a wildcard identifier, for example '*.example.com'.") - public Boolean getWildcard() { - return wildcard; - } - - public void setWildcard(Boolean wildcard) { - this.wildcard = wildcard; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeSpec v1beta1ChallengeSpec = (V1beta1ChallengeSpec) o; - return Objects.equals(this.authorizationURL, v1beta1ChallengeSpec.authorizationURL) - && Objects.equals(this.dnsName, v1beta1ChallengeSpec.dnsName) - && Objects.equals(this.issuerRef, v1beta1ChallengeSpec.issuerRef) - && Objects.equals(this.key, v1beta1ChallengeSpec.key) - && Objects.equals(this.solver, v1beta1ChallengeSpec.solver) - && Objects.equals(this.token, v1beta1ChallengeSpec.token) - && Objects.equals(this.type, v1beta1ChallengeSpec.type) - && Objects.equals(this.url, v1beta1ChallengeSpec.url) - && Objects.equals(this.wildcard, v1beta1ChallengeSpec.wildcard); - } - - @Override - public int hashCode() { - return Objects.hash( - authorizationURL, dnsName, issuerRef, key, solver, token, type, url, wildcard); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeSpec {\n"); - sb.append(" authorizationURL: ").append(toIndentedString(authorizationURL)).append("\n"); - sb.append(" dnsName: ").append(toIndentedString(dnsName)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" solver: ").append(toIndentedString(solver)).append("\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java deleted file mode 100644 index f1d66ecfd2..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecIssuerRef.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * References a properly configured ACME-type Issuer which should be used to create this Challenge. - * If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' - * Issuer, an error will be returned and the Challenge will be marked as failed. - */ -@ApiModel( - description = - "References a properly configured ACME-type Issuer which should be used to create this Challenge. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Challenge will be marked as failed.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeSpecIssuerRef { - public static final String SERIALIZED_NAME_GROUP = "group"; - - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1ChallengeSpecIssuerRef group(String group) { - - this.group = group; - return this; - } - - /** - * Group of the resource being referred to. - * - * @return group - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Group of the resource being referred to.") - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public V1beta1ChallengeSpecIssuerRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind of the resource being referred to. - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind of the resource being referred to.") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1ChallengeSpecIssuerRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. - * - * @return name - */ - @ApiModelProperty(required = true, value = "Name of the resource being referred to.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeSpecIssuerRef v1beta1ChallengeSpecIssuerRef = (V1beta1ChallengeSpecIssuerRef) o; - return Objects.equals(this.group, v1beta1ChallengeSpecIssuerRef.group) - && Objects.equals(this.kind, v1beta1ChallengeSpecIssuerRef.kind) - && Objects.equals(this.name, v1beta1ChallengeSpecIssuerRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(group, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeSpecIssuerRef {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java deleted file mode 100644 index 968a80e880..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolver.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Contains the domain solving configuration that should be used to solve this challenge resource. - */ -@ApiModel( - description = - "Contains the domain solving configuration that should be used to solve this challenge resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeSpecSolver { - public static final String SERIALIZED_NAME_DNS01 = "dns01"; - - @SerializedName(SERIALIZED_NAME_DNS01) - private V1beta1ChallengeSpecSolverDns01 dns01; - - public static final String SERIALIZED_NAME_HTTP01 = "http01"; - - @SerializedName(SERIALIZED_NAME_HTTP01) - private V1alpha2IssuerSpecAcmeHttp01 http01; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1alpha2IssuerSpecAcmeSelector selector; - - public V1beta1ChallengeSpecSolver dns01(V1beta1ChallengeSpecSolverDns01 dns01) { - - this.dns01 = dns01; - return this; - } - - /** - * Get dns01 - * - * @return dns01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1ChallengeSpecSolverDns01 getDns01() { - return dns01; - } - - public void setDns01(V1beta1ChallengeSpecSolverDns01 dns01) { - this.dns01 = dns01; - } - - public V1beta1ChallengeSpecSolver http01(V1alpha2IssuerSpecAcmeHttp01 http01) { - - this.http01 = http01; - return this; - } - - /** - * Get http01 - * - * @return http01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { - return http01; - } - - public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { - this.http01 = http01; - } - - public V1beta1ChallengeSpecSolver selector(V1alpha2IssuerSpecAcmeSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * - * @return selector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeSelector getSelector() { - return selector; - } - - public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { - this.selector = selector; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeSpecSolver v1beta1ChallengeSpecSolver = (V1beta1ChallengeSpecSolver) o; - return Objects.equals(this.dns01, v1beta1ChallengeSpecSolver.dns01) - && Objects.equals(this.http01, v1beta1ChallengeSpecSolver.http01) - && Objects.equals(this.selector, v1beta1ChallengeSpecSolver.selector); - } - - @Override - public int hashCode() { - return Objects.hash(dns01, http01, selector); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeSpecSolver {\n"); - sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); - sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java deleted file mode 100644 index 764ee818a7..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeSpecSolverDns01.java +++ /dev/null @@ -1,414 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** - * Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge - * flow. - */ -@ApiModel( - description = - "Configures cert-manager to attempt to complete authorizations by performing the DNS01 challenge flow.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeSpecSolverDns01 { - public static final String SERIALIZED_NAME_ACME_D_N_S = "acmeDNS"; - - @SerializedName(SERIALIZED_NAME_ACME_D_N_S) - private V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS; - - public static final String SERIALIZED_NAME_AKAMAI = "akamai"; - - @SerializedName(SERIALIZED_NAME_AKAMAI) - private V1alpha2IssuerSpecAcmeDns01Akamai akamai; - - public static final String SERIALIZED_NAME_AZURE_D_N_S = "azureDNS"; - - @SerializedName(SERIALIZED_NAME_AZURE_D_N_S) - private V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS; - - public static final String SERIALIZED_NAME_CLOUD_D_N_S = "cloudDNS"; - - @SerializedName(SERIALIZED_NAME_CLOUD_D_N_S) - private V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS; - - public static final String SERIALIZED_NAME_CLOUDFLARE = "cloudflare"; - - @SerializedName(SERIALIZED_NAME_CLOUDFLARE) - private V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare; - - /** - * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS - * zones. - */ - @JsonAdapter(CnameStrategyEnum.Adapter.class) - public enum CnameStrategyEnum { - NONE("None"), - - FOLLOW("Follow"); - - private String value; - - CnameStrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CnameStrategyEnum fromValue(String value) { - for (CnameStrategyEnum b : CnameStrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CnameStrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CnameStrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CnameStrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_CNAME_STRATEGY = "cnameStrategy"; - - @SerializedName(SERIALIZED_NAME_CNAME_STRATEGY) - private CnameStrategyEnum cnameStrategy; - - public static final String SERIALIZED_NAME_DIGITALOCEAN = "digitalocean"; - - @SerializedName(SERIALIZED_NAME_DIGITALOCEAN) - private V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean; - - public static final String SERIALIZED_NAME_RFC2136 = "rfc2136"; - - @SerializedName(SERIALIZED_NAME_RFC2136) - private V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136; - - public static final String SERIALIZED_NAME_ROUTE53 = "route53"; - - @SerializedName(SERIALIZED_NAME_ROUTE53) - private V1alpha2IssuerSpecAcmeDns01Route53 route53; - - public static final String SERIALIZED_NAME_WEBHOOK = "webhook"; - - @SerializedName(SERIALIZED_NAME_WEBHOOK) - private V1alpha2IssuerSpecAcmeDns01Webhook webhook; - - public V1beta1ChallengeSpecSolverDns01 acmeDNS(V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS) { - - this.acmeDNS = acmeDNS; - return this; - } - - /** - * Get acmeDNS - * - * @return acmeDNS - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Acmedns getAcmeDNS() { - return acmeDNS; - } - - public void setAcmeDNS(V1alpha2IssuerSpecAcmeDns01Acmedns acmeDNS) { - this.acmeDNS = acmeDNS; - } - - public V1beta1ChallengeSpecSolverDns01 akamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { - - this.akamai = akamai; - return this; - } - - /** - * Get akamai - * - * @return akamai - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Akamai getAkamai() { - return akamai; - } - - public void setAkamai(V1alpha2IssuerSpecAcmeDns01Akamai akamai) { - this.akamai = akamai; - } - - public V1beta1ChallengeSpecSolverDns01 azureDNS(V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS) { - - this.azureDNS = azureDNS; - return this; - } - - /** - * Get azureDNS - * - * @return azureDNS - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Azuredns getAzureDNS() { - return azureDNS; - } - - public void setAzureDNS(V1alpha2IssuerSpecAcmeDns01Azuredns azureDNS) { - this.azureDNS = azureDNS; - } - - public V1beta1ChallengeSpecSolverDns01 cloudDNS(V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS) { - - this.cloudDNS = cloudDNS; - return this; - } - - /** - * Get cloudDNS - * - * @return cloudDNS - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Clouddns getCloudDNS() { - return cloudDNS; - } - - public void setCloudDNS(V1alpha2IssuerSpecAcmeDns01Clouddns cloudDNS) { - this.cloudDNS = cloudDNS; - } - - public V1beta1ChallengeSpecSolverDns01 cloudflare( - V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { - - this.cloudflare = cloudflare; - return this; - } - - /** - * Get cloudflare - * - * @return cloudflare - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Cloudflare getCloudflare() { - return cloudflare; - } - - public void setCloudflare(V1alpha2IssuerSpecAcmeDns01Cloudflare cloudflare) { - this.cloudflare = cloudflare; - } - - public V1beta1ChallengeSpecSolverDns01 cnameStrategy(CnameStrategyEnum cnameStrategy) { - - this.cnameStrategy = cnameStrategy; - return this; - } - - /** - * CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS - * zones. - * - * @return cnameStrategy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CNAMEStrategy configures how the DNS01 provider should handle CNAME records when found in DNS zones.") - public CnameStrategyEnum getCnameStrategy() { - return cnameStrategy; - } - - public void setCnameStrategy(CnameStrategyEnum cnameStrategy) { - this.cnameStrategy = cnameStrategy; - } - - public V1beta1ChallengeSpecSolverDns01 digitalocean( - V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { - - this.digitalocean = digitalocean; - return this; - } - - /** - * Get digitalocean - * - * @return digitalocean - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Digitalocean getDigitalocean() { - return digitalocean; - } - - public void setDigitalocean(V1alpha2IssuerSpecAcmeDns01Digitalocean digitalocean) { - this.digitalocean = digitalocean; - } - - public V1beta1ChallengeSpecSolverDns01 rfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { - - this.rfc2136 = rfc2136; - return this; - } - - /** - * Get rfc2136 - * - * @return rfc2136 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Rfc2136 getRfc2136() { - return rfc2136; - } - - public void setRfc2136(V1alpha2IssuerSpecAcmeDns01Rfc2136 rfc2136) { - this.rfc2136 = rfc2136; - } - - public V1beta1ChallengeSpecSolverDns01 route53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { - - this.route53 = route53; - return this; - } - - /** - * Get route53 - * - * @return route53 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Route53 getRoute53() { - return route53; - } - - public void setRoute53(V1alpha2IssuerSpecAcmeDns01Route53 route53) { - this.route53 = route53; - } - - public V1beta1ChallengeSpecSolverDns01 webhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { - - this.webhook = webhook; - return this; - } - - /** - * Get webhook - * - * @return webhook - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeDns01Webhook getWebhook() { - return webhook; - } - - public void setWebhook(V1alpha2IssuerSpecAcmeDns01Webhook webhook) { - this.webhook = webhook; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeSpecSolverDns01 v1beta1ChallengeSpecSolverDns01 = - (V1beta1ChallengeSpecSolverDns01) o; - return Objects.equals(this.acmeDNS, v1beta1ChallengeSpecSolverDns01.acmeDNS) - && Objects.equals(this.akamai, v1beta1ChallengeSpecSolverDns01.akamai) - && Objects.equals(this.azureDNS, v1beta1ChallengeSpecSolverDns01.azureDNS) - && Objects.equals(this.cloudDNS, v1beta1ChallengeSpecSolverDns01.cloudDNS) - && Objects.equals(this.cloudflare, v1beta1ChallengeSpecSolverDns01.cloudflare) - && Objects.equals(this.cnameStrategy, v1beta1ChallengeSpecSolverDns01.cnameStrategy) - && Objects.equals(this.digitalocean, v1beta1ChallengeSpecSolverDns01.digitalocean) - && Objects.equals(this.rfc2136, v1beta1ChallengeSpecSolverDns01.rfc2136) - && Objects.equals(this.route53, v1beta1ChallengeSpecSolverDns01.route53) - && Objects.equals(this.webhook, v1beta1ChallengeSpecSolverDns01.webhook); - } - - @Override - public int hashCode() { - return Objects.hash( - acmeDNS, - akamai, - azureDNS, - cloudDNS, - cloudflare, - cnameStrategy, - digitalocean, - rfc2136, - route53, - webhook); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeSpecSolverDns01 {\n"); - sb.append(" acmeDNS: ").append(toIndentedString(acmeDNS)).append("\n"); - sb.append(" akamai: ").append(toIndentedString(akamai)).append("\n"); - sb.append(" azureDNS: ").append(toIndentedString(azureDNS)).append("\n"); - sb.append(" cloudDNS: ").append(toIndentedString(cloudDNS)).append("\n"); - sb.append(" cloudflare: ").append(toIndentedString(cloudflare)).append("\n"); - sb.append(" cnameStrategy: ").append(toIndentedString(cnameStrategy)).append("\n"); - sb.append(" digitalocean: ").append(toIndentedString(digitalocean)).append("\n"); - sb.append(" rfc2136: ").append(toIndentedString(rfc2136)).append("\n"); - sb.append(" route53: ").append(toIndentedString(route53)).append("\n"); - sb.append(" webhook: ").append(toIndentedString(webhook)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java deleted file mode 100644 index 0ff107d7db..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ChallengeStatus.java +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; - -/** V1beta1ChallengeStatus */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ChallengeStatus { - public static final String SERIALIZED_NAME_PRESENTED = "presented"; - - @SerializedName(SERIALIZED_NAME_PRESENTED) - private Boolean presented; - - public static final String SERIALIZED_NAME_PROCESSING = "processing"; - - @SerializedName(SERIALIZED_NAME_PROCESSING) - private Boolean processing; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** - * Contains the current 'state' of the challenge. If not set, the state of the challenge - * is unknown. - */ - @JsonAdapter(StateEnum.Adapter.class) - public enum StateEnum { - VALID("valid"), - - READY("ready"), - - PENDING("pending"), - - PROCESSING("processing"), - - INVALID("invalid"), - - EXPIRED("expired"), - - ERRORED("errored"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StateEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StateEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATE = "state"; - - @SerializedName(SERIALIZED_NAME_STATE) - private StateEnum state; - - public V1beta1ChallengeStatus presented(Boolean presented) { - - this.presented = presented; - return this; - } - - /** - * presented will be set to true if the challenge values for this challenge are currently - * 'presented'. This *does not* imply the self check is passing. Only that the values have - * been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has - * been presented, or the HTTP01 configuration has been configured). - * - * @return presented - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "presented will be set to true if the challenge values for this challenge are currently 'presented'. This *does not* imply the self check is passing. Only that the values have been 'submitted' for the appropriate challenge mechanism (i.e. the DNS01 TXT record has been presented, or the HTTP01 configuration has been configured).") - public Boolean getPresented() { - return presented; - } - - public void setPresented(Boolean presented) { - this.presented = presented; - } - - public V1beta1ChallengeStatus processing(Boolean processing) { - - this.processing = processing; - return this; - } - - /** - * Used to denote whether this challenge should be processed or not. This field will only be set - * to true by the 'scheduling' component. It will only be set to false by the - * 'challenges' controller, after the challenge has reached a final state or timed out. If - * this field is set to false, the challenge controller will not take any more action. - * - * @return processing - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Used to denote whether this challenge should be processed or not. This field will only be set to true by the 'scheduling' component. It will only be set to false by the 'challenges' controller, after the challenge has reached a final state or timed out. If this field is set to false, the challenge controller will not take any more action.") - public Boolean getProcessing() { - return processing; - } - - public void setProcessing(Boolean processing) { - this.processing = processing; - } - - public V1beta1ChallengeStatus reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Contains human readable information on why the Challenge is in the current state. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Contains human readable information on why the Challenge is in the current state.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1beta1ChallengeStatus state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * Contains the current 'state' of the challenge. If not set, the state of the challenge - * is unknown. - * - * @return state - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Contains the current 'state' of the challenge. If not set, the state of the challenge is unknown.") - public StateEnum getState() { - return state; - } - - public void setState(StateEnum state) { - this.state = state; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ChallengeStatus v1beta1ChallengeStatus = (V1beta1ChallengeStatus) o; - return Objects.equals(this.presented, v1beta1ChallengeStatus.presented) - && Objects.equals(this.processing, v1beta1ChallengeStatus.processing) - && Objects.equals(this.reason, v1beta1ChallengeStatus.reason) - && Objects.equals(this.state, v1beta1ChallengeStatus.state); - } - - @Override - public int hashCode() { - return Objects.hash(presented, processing, reason, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ChallengeStatus {\n"); - sb.append(" presented: ").append(toIndentedString(presented)).append("\n"); - sb.append(" processing: ").append(toIndentedString(processing)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java deleted file mode 100644 index bf21ddf0aa..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuer.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * A ClusterIssuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and - * therefore can be referenced by resources that exist in *any* namespace, not just the same - * namespace as the referent. - */ -@ApiModel( - description = - "A ClusterIssuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is similar to an Issuer, however it is cluster-scoped and therefore can be referenced by resources that exist in *any* namespace, not just the same namespace as the referent.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ClusterIssuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1ClusterIssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha3ClusterIssuerStatus status; - - public V1beta1ClusterIssuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1ClusterIssuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1ClusterIssuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1ClusterIssuer spec(V1beta1ClusterIssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1ClusterIssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1ClusterIssuerSpec spec) { - this.spec = spec; - } - - public V1beta1ClusterIssuer status(V1alpha3ClusterIssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha3ClusterIssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha3ClusterIssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ClusterIssuer v1beta1ClusterIssuer = (V1beta1ClusterIssuer) o; - return Objects.equals(this.apiVersion, v1beta1ClusterIssuer.apiVersion) - && Objects.equals(this.kind, v1beta1ClusterIssuer.kind) - && Objects.equals(this.metadata, v1beta1ClusterIssuer.metadata) - && Objects.equals(this.spec, v1beta1ClusterIssuer.spec) - && Objects.equals(this.status, v1beta1ClusterIssuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ClusterIssuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java deleted file mode 100644 index 86b3c10195..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** ClusterIssuerList is a list of ClusterIssuer */ -@ApiModel(description = "ClusterIssuerList is a list of ClusterIssuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ClusterIssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1ClusterIssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1ClusterIssuerList items(List items) { - - this.items = items; - return this; - } - - public V1beta1ClusterIssuerList addItemsItem(V1beta1ClusterIssuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of clusterissuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of clusterissuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1ClusterIssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1ClusterIssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ClusterIssuerList v1beta1ClusterIssuerList = (V1beta1ClusterIssuerList) o; - return Objects.equals(this.apiVersion, v1beta1ClusterIssuerList.apiVersion) - && Objects.equals(this.items, v1beta1ClusterIssuerList.items) - && Objects.equals(this.kind, v1beta1ClusterIssuerList.kind) - && Objects.equals(this.metadata, v1beta1ClusterIssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ClusterIssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java deleted file mode 100644 index 04c1c349b3..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1ClusterIssuerSpec.java +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Desired state of the ClusterIssuer resource. */ -@ApiModel(description = "Desired state of the ClusterIssuer resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1ClusterIssuerSpec { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1beta1IssuerSpecAcme acme; - - public static final String SERIALIZED_NAME_CA = "ca"; - - @SerializedName(SERIALIZED_NAME_CA) - private V1alpha2IssuerSpecCa ca; - - public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; - - @SerializedName(SERIALIZED_NAME_SELF_SIGNED) - private V1alpha2IssuerSpecSelfSigned selfSigned; - - public static final String SERIALIZED_NAME_VAULT = "vault"; - - @SerializedName(SERIALIZED_NAME_VAULT) - private V1alpha2IssuerSpecVault vault; - - public static final String SERIALIZED_NAME_VENAFI = "venafi"; - - @SerializedName(SERIALIZED_NAME_VENAFI) - private V1alpha2IssuerSpecVenafi venafi; - - public V1beta1ClusterIssuerSpec acme(V1beta1IssuerSpecAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1IssuerSpecAcme getAcme() { - return acme; - } - - public void setAcme(V1beta1IssuerSpecAcme acme) { - this.acme = acme; - } - - public V1beta1ClusterIssuerSpec ca(V1alpha2IssuerSpecCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * - * @return ca - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecCa getCa() { - return ca; - } - - public void setCa(V1alpha2IssuerSpecCa ca) { - this.ca = ca; - } - - public V1beta1ClusterIssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - - this.selfSigned = selfSigned; - return this; - } - - /** - * Get selfSigned - * - * @return selfSigned - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecSelfSigned getSelfSigned() { - return selfSigned; - } - - public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - this.selfSigned = selfSigned; - } - - public V1beta1ClusterIssuerSpec vault(V1alpha2IssuerSpecVault vault) { - - this.vault = vault; - return this; - } - - /** - * Get vault - * - * @return vault - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVault getVault() { - return vault; - } - - public void setVault(V1alpha2IssuerSpecVault vault) { - this.vault = vault; - } - - public V1beta1ClusterIssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { - - this.venafi = venafi; - return this; - } - - /** - * Get venafi - * - * @return venafi - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafi getVenafi() { - return venafi; - } - - public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { - this.venafi = venafi; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1ClusterIssuerSpec v1beta1ClusterIssuerSpec = (V1beta1ClusterIssuerSpec) o; - return Objects.equals(this.acme, v1beta1ClusterIssuerSpec.acme) - && Objects.equals(this.ca, v1beta1ClusterIssuerSpec.ca) - && Objects.equals(this.selfSigned, v1beta1ClusterIssuerSpec.selfSigned) - && Objects.equals(this.vault, v1beta1ClusterIssuerSpec.vault) - && Objects.equals(this.venafi, v1beta1ClusterIssuerSpec.venafi); - } - - @Override - public int hashCode() { - return Objects.hash(acme, ca, selfSigned, vault, venafi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1ClusterIssuerSpec {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); - sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); - sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java deleted file mode 100644 index 76c39656c0..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Issuer.java +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * An Issuer represents a certificate issuing authority which can be referenced as part of - * `issuerRef` fields. It is scoped to a single namespace and can therefore only be - * referenced by resources within the same namespace. - */ -@ApiModel( - description = - "An Issuer represents a certificate issuing authority which can be referenced as part of `issuerRef` fields. It is scoped to a single namespace and can therefore only be referenced by resources within the same namespace.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1Issuer implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1IssuerSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha2IssuerStatus status; - - public V1beta1Issuer apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1Issuer kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1Issuer metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1Issuer spec(V1beta1IssuerSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1IssuerSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1IssuerSpec spec) { - this.spec = spec; - } - - public V1beta1Issuer status(V1alpha2IssuerStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerStatus getStatus() { - return status; - } - - public void setStatus(V1alpha2IssuerStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1Issuer v1beta1Issuer = (V1beta1Issuer) o; - return Objects.equals(this.apiVersion, v1beta1Issuer.apiVersion) - && Objects.equals(this.kind, v1beta1Issuer.kind) - && Objects.equals(this.metadata, v1beta1Issuer.metadata) - && Objects.equals(this.spec, v1beta1Issuer.spec) - && Objects.equals(this.status, v1beta1Issuer.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1Issuer {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java deleted file mode 100644 index 6fc652ddff..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** IssuerList is a list of Issuer */ -@ApiModel(description = "IssuerList is a list of Issuer") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1IssuerList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1IssuerList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1IssuerList items(List items) { - - this.items = items; - return this; - } - - public V1beta1IssuerList addItemsItem(V1beta1Issuer itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of issuers. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of issuers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1IssuerList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1IssuerList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1IssuerList v1beta1IssuerList = (V1beta1IssuerList) o; - return Objects.equals(this.apiVersion, v1beta1IssuerList.apiVersion) - && Objects.equals(this.items, v1beta1IssuerList.items) - && Objects.equals(this.kind, v1beta1IssuerList.kind) - && Objects.equals(this.metadata, v1beta1IssuerList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1IssuerList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java deleted file mode 100644 index 610ee2772c..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpec.java +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Desired state of the Issuer resource. */ -@ApiModel(description = "Desired state of the Issuer resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1IssuerSpec { - public static final String SERIALIZED_NAME_ACME = "acme"; - - @SerializedName(SERIALIZED_NAME_ACME) - private V1beta1IssuerSpecAcme acme; - - public static final String SERIALIZED_NAME_CA = "ca"; - - @SerializedName(SERIALIZED_NAME_CA) - private V1alpha2IssuerSpecCa ca; - - public static final String SERIALIZED_NAME_SELF_SIGNED = "selfSigned"; - - @SerializedName(SERIALIZED_NAME_SELF_SIGNED) - private V1alpha2IssuerSpecSelfSigned selfSigned; - - public static final String SERIALIZED_NAME_VAULT = "vault"; - - @SerializedName(SERIALIZED_NAME_VAULT) - private V1alpha2IssuerSpecVault vault; - - public static final String SERIALIZED_NAME_VENAFI = "venafi"; - - @SerializedName(SERIALIZED_NAME_VENAFI) - private V1alpha2IssuerSpecVenafi venafi; - - public V1beta1IssuerSpec acme(V1beta1IssuerSpecAcme acme) { - - this.acme = acme; - return this; - } - - /** - * Get acme - * - * @return acme - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1IssuerSpecAcme getAcme() { - return acme; - } - - public void setAcme(V1beta1IssuerSpecAcme acme) { - this.acme = acme; - } - - public V1beta1IssuerSpec ca(V1alpha2IssuerSpecCa ca) { - - this.ca = ca; - return this; - } - - /** - * Get ca - * - * @return ca - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecCa getCa() { - return ca; - } - - public void setCa(V1alpha2IssuerSpecCa ca) { - this.ca = ca; - } - - public V1beta1IssuerSpec selfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - - this.selfSigned = selfSigned; - return this; - } - - /** - * Get selfSigned - * - * @return selfSigned - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecSelfSigned getSelfSigned() { - return selfSigned; - } - - public void setSelfSigned(V1alpha2IssuerSpecSelfSigned selfSigned) { - this.selfSigned = selfSigned; - } - - public V1beta1IssuerSpec vault(V1alpha2IssuerSpecVault vault) { - - this.vault = vault; - return this; - } - - /** - * Get vault - * - * @return vault - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVault getVault() { - return vault; - } - - public void setVault(V1alpha2IssuerSpecVault vault) { - this.vault = vault; - } - - public V1beta1IssuerSpec venafi(V1alpha2IssuerSpecVenafi venafi) { - - this.venafi = venafi; - return this; - } - - /** - * Get venafi - * - * @return venafi - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecVenafi getVenafi() { - return venafi; - } - - public void setVenafi(V1alpha2IssuerSpecVenafi venafi) { - this.venafi = venafi; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1IssuerSpec v1beta1IssuerSpec = (V1beta1IssuerSpec) o; - return Objects.equals(this.acme, v1beta1IssuerSpec.acme) - && Objects.equals(this.ca, v1beta1IssuerSpec.ca) - && Objects.equals(this.selfSigned, v1beta1IssuerSpec.selfSigned) - && Objects.equals(this.vault, v1beta1IssuerSpec.vault) - && Objects.equals(this.venafi, v1beta1IssuerSpec.venafi); - } - - @Override - public int hashCode() { - return Objects.hash(acme, ca, selfSigned, vault, venafi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1IssuerSpec {\n"); - sb.append(" acme: ").append(toIndentedString(acme)).append("\n"); - sb.append(" ca: ").append(toIndentedString(ca)).append("\n"); - sb.append(" selfSigned: ").append(toIndentedString(selfSigned)).append("\n"); - sb.append(" vault: ").append(toIndentedString(vault)).append("\n"); - sb.append(" venafi: ").append(toIndentedString(venafi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java deleted file mode 100644 index 2a7b358d7b..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcme.java +++ /dev/null @@ -1,270 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 - * certificates. - */ -@ApiModel( - description = - "ACME configures this issuer to communicate with a RFC8555 (ACME) server to obtain signed x509 certificates.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1IssuerSpecAcme { - public static final String SERIALIZED_NAME_EMAIL = "email"; - - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING = "externalAccountBinding"; - - @SerializedName(SERIALIZED_NAME_EXTERNAL_ACCOUNT_BINDING) - private V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding; - - public static final String SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF = "privateKeySecretRef"; - - @SerializedName(SERIALIZED_NAME_PRIVATE_KEY_SECRET_REF) - private V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef; - - public static final String SERIALIZED_NAME_SERVER = "server"; - - @SerializedName(SERIALIZED_NAME_SERVER) - private String server; - - public static final String SERIALIZED_NAME_SKIP_T_L_S_VERIFY = "skipTLSVerify"; - - @SerializedName(SERIALIZED_NAME_SKIP_T_L_S_VERIFY) - private Boolean skipTLSVerify; - - public static final String SERIALIZED_NAME_SOLVERS = "solvers"; - - @SerializedName(SERIALIZED_NAME_SOLVERS) - private List solvers = null; - - public V1beta1IssuerSpecAcme email(String email) { - - this.email = email; - return this; - } - - /** - * Email is the email address to be associated with the ACME account. This field is optional, but - * it is strongly recommended to be set. It will be used to contact you in case of issues with - * your account or certificates, including expiry notification emails. This field may be updated - * after the account is initially registered. - * - * @return email - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Email is the email address to be associated with the ACME account. This field is optional, but it is strongly recommended to be set. It will be used to contact you in case of issues with your account or certificates, including expiry notification emails. This field may be updated after the account is initially registered.") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public V1beta1IssuerSpecAcme externalAccountBinding( - V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { - - this.externalAccountBinding = externalAccountBinding; - return this; - } - - /** - * Get externalAccountBinding - * - * @return externalAccountBinding - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeExternalAccountBinding getExternalAccountBinding() { - return externalAccountBinding; - } - - public void setExternalAccountBinding( - V1alpha2IssuerSpecAcmeExternalAccountBinding externalAccountBinding) { - this.externalAccountBinding = externalAccountBinding; - } - - public V1beta1IssuerSpecAcme privateKeySecretRef( - V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { - - this.privateKeySecretRef = privateKeySecretRef; - return this; - } - - /** - * Get privateKeySecretRef - * - * @return privateKeySecretRef - */ - @ApiModelProperty(required = true, value = "") - public V1alpha2IssuerSpecAcmePrivateKeySecretRef getPrivateKeySecretRef() { - return privateKeySecretRef; - } - - public void setPrivateKeySecretRef( - V1alpha2IssuerSpecAcmePrivateKeySecretRef privateKeySecretRef) { - this.privateKeySecretRef = privateKeySecretRef; - } - - public V1beta1IssuerSpecAcme server(String server) { - - this.server = server; - return this; - } - - /** - * Server is the URL used to access the ACME server's 'directory' endpoint. For - * example, for Let's Encrypt's staging endpoint, you would use: - * \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints - * (i.e. RFC 8555) are supported. - * - * @return server - */ - @ApiModelProperty( - required = true, - value = - "Server is the URL used to access the ACME server's 'directory' endpoint. For example, for Let's Encrypt's staging endpoint, you would use: \"https://acme-staging-v02.api.letsencrypt.org/directory\". Only ACME v2 endpoints (i.e. RFC 8555) are supported.") - public String getServer() { - return server; - } - - public void setServer(String server) { - this.server = server; - } - - public V1beta1IssuerSpecAcme skipTLSVerify(Boolean skipTLSVerify) { - - this.skipTLSVerify = skipTLSVerify; - return this; - } - - /** - * Enables or disables validation of the ACME server TLS certificate. If true, requests to the - * ACME server will not have their TLS certificate validated (i.e. insecure connections will be - * allowed). Only enable this option in development environments. The cert-manager system - * installed roots will be used to verify connections to the ACME server if this is false. - * Defaults to false. - * - * @return skipTLSVerify - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enables or disables validation of the ACME server TLS certificate. If true, requests to the ACME server will not have their TLS certificate validated (i.e. insecure connections will be allowed). Only enable this option in development environments. The cert-manager system installed roots will be used to verify connections to the ACME server if this is false. Defaults to false.") - public Boolean getSkipTLSVerify() { - return skipTLSVerify; - } - - public void setSkipTLSVerify(Boolean skipTLSVerify) { - this.skipTLSVerify = skipTLSVerify; - } - - public V1beta1IssuerSpecAcme solvers(List solvers) { - - this.solvers = solvers; - return this; - } - - public V1beta1IssuerSpecAcme addSolversItem(V1beta1IssuerSpecAcmeSolvers solversItem) { - if (this.solvers == null) { - this.solvers = new ArrayList(); - } - this.solvers.add(solversItem); - return this; - } - - /** - * Solvers is a list of challenge solvers that will be used to solve ACME challenges for the - * matching domains. Solver configurations must be provided in order to obtain certificates from - * an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/ - * - * @return solvers - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Solvers is a list of challenge solvers that will be used to solve ACME challenges for the matching domains. Solver configurations must be provided in order to obtain certificates from an ACME server. For more information, see: https://cert-manager.io/docs/configuration/acme/") - public List getSolvers() { - return solvers; - } - - public void setSolvers(List solvers) { - this.solvers = solvers; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1IssuerSpecAcme v1beta1IssuerSpecAcme = (V1beta1IssuerSpecAcme) o; - return Objects.equals(this.email, v1beta1IssuerSpecAcme.email) - && Objects.equals(this.externalAccountBinding, v1beta1IssuerSpecAcme.externalAccountBinding) - && Objects.equals(this.privateKeySecretRef, v1beta1IssuerSpecAcme.privateKeySecretRef) - && Objects.equals(this.server, v1beta1IssuerSpecAcme.server) - && Objects.equals(this.skipTLSVerify, v1beta1IssuerSpecAcme.skipTLSVerify) - && Objects.equals(this.solvers, v1beta1IssuerSpecAcme.solvers); - } - - @Override - public int hashCode() { - return Objects.hash( - email, externalAccountBinding, privateKeySecretRef, server, skipTLSVerify, solvers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1IssuerSpecAcme {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" externalAccountBinding: ") - .append(toIndentedString(externalAccountBinding)) - .append("\n"); - sb.append(" privateKeySecretRef: ") - .append(toIndentedString(privateKeySecretRef)) - .append("\n"); - sb.append(" server: ").append(toIndentedString(server)).append("\n"); - sb.append(" skipTLSVerify: ").append(toIndentedString(skipTLSVerify)).append("\n"); - sb.append(" solvers: ").append(toIndentedString(solvers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java deleted file mode 100644 index 247b6ffc26..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1IssuerSpecAcmeSolvers.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 - * may be provided. - */ -@ApiModel( - description = - "Configures an issuer to solve challenges using the specified options. Only one of HTTP01 or DNS01 may be provided.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1IssuerSpecAcmeSolvers { - public static final String SERIALIZED_NAME_DNS01 = "dns01"; - - @SerializedName(SERIALIZED_NAME_DNS01) - private V1beta1ChallengeSpecSolverDns01 dns01; - - public static final String SERIALIZED_NAME_HTTP01 = "http01"; - - @SerializedName(SERIALIZED_NAME_HTTP01) - private V1alpha2IssuerSpecAcmeHttp01 http01; - - public static final String SERIALIZED_NAME_SELECTOR = "selector"; - - @SerializedName(SERIALIZED_NAME_SELECTOR) - private V1alpha2IssuerSpecAcmeSelector selector; - - public V1beta1IssuerSpecAcmeSolvers dns01(V1beta1ChallengeSpecSolverDns01 dns01) { - - this.dns01 = dns01; - return this; - } - - /** - * Get dns01 - * - * @return dns01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1ChallengeSpecSolverDns01 getDns01() { - return dns01; - } - - public void setDns01(V1beta1ChallengeSpecSolverDns01 dns01) { - this.dns01 = dns01; - } - - public V1beta1IssuerSpecAcmeSolvers http01(V1alpha2IssuerSpecAcmeHttp01 http01) { - - this.http01 = http01; - return this; - } - - /** - * Get http01 - * - * @return http01 - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeHttp01 getHttp01() { - return http01; - } - - public void setHttp01(V1alpha2IssuerSpecAcmeHttp01 http01) { - this.http01 = http01; - } - - public V1beta1IssuerSpecAcmeSolvers selector(V1alpha2IssuerSpecAcmeSelector selector) { - - this.selector = selector; - return this; - } - - /** - * Get selector - * - * @return selector - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1alpha2IssuerSpecAcmeSelector getSelector() { - return selector; - } - - public void setSelector(V1alpha2IssuerSpecAcmeSelector selector) { - this.selector = selector; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1IssuerSpecAcmeSolvers v1beta1IssuerSpecAcmeSolvers = (V1beta1IssuerSpecAcmeSolvers) o; - return Objects.equals(this.dns01, v1beta1IssuerSpecAcmeSolvers.dns01) - && Objects.equals(this.http01, v1beta1IssuerSpecAcmeSolvers.http01) - && Objects.equals(this.selector, v1beta1IssuerSpecAcmeSolvers.selector); - } - - @Override - public int hashCode() { - return Objects.hash(dns01, http01, selector); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1IssuerSpecAcmeSolvers {\n"); - sb.append(" dns01: ").append(toIndentedString(dns01)).append("\n"); - sb.append(" http01: ").append(toIndentedString(http01)).append("\n"); - sb.append(" selector: ").append(toIndentedString(selector)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java deleted file mode 100644 index 01d5a86471..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1Order.java +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** Order is a type to represent an Order with an ACME server */ -@ApiModel(description = "Order is a type to represent an Order with an ACME server") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1Order implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata = null; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private V1beta1OrderSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private V1beta1OrderStatus status; - - public V1beta1Order apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1Order kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1Order metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @ApiModelProperty(required = true, value = "") - public V1ObjectMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - public V1beta1Order spec(V1beta1OrderSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * - * @return spec - */ - @ApiModelProperty(required = true, value = "") - public V1beta1OrderSpec getSpec() { - return spec; - } - - public void setSpec(V1beta1OrderSpec spec) { - this.spec = spec; - } - - public V1beta1Order status(V1beta1OrderStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1beta1OrderStatus getStatus() { - return status; - } - - public void setStatus(V1beta1OrderStatus status) { - this.status = status; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1Order v1beta1Order = (V1beta1Order) o; - return Objects.equals(this.apiVersion, v1beta1Order.apiVersion) - && Objects.equals(this.kind, v1beta1Order.kind) - && Objects.equals(this.metadata, v1beta1Order.metadata) - && Objects.equals(this.spec, v1beta1Order.spec) - && Objects.equals(this.status, v1beta1Order.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1Order {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java deleted file mode 100644 index 6c402e8c97..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderList.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** OrderList is a list of Order */ -@ApiModel(description = "OrderList is a list of Order") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata = null; - - public V1beta1OrderList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should - * convert recognized schemas to the latest internal value, and may reject unrecognized values. - * More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * - * @return apiVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public V1beta1OrderList items(List items) { - - this.items = items; - return this; - } - - public V1beta1OrderList addItemsItem(V1beta1Order itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * List of orders. More info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - * - * @return items - */ - @ApiModelProperty( - required = true, - value = - "List of orders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public V1beta1OrderList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer - * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More - * info: - * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1OrderList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public V1ListMeta getMetadata() { - return metadata; - } - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderList v1beta1OrderList = (V1beta1OrderList) o; - return Objects.equals(this.apiVersion, v1beta1OrderList.apiVersion) - && Objects.equals(this.items, v1beta1OrderList.items) - && Objects.equals(this.kind, v1beta1OrderList.kind) - && Objects.equals(this.metadata, v1beta1OrderList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java deleted file mode 100644 index 167b89fc93..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpec.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** V1beta1OrderSpec */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderSpec { - public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; - - @SerializedName(SERIALIZED_NAME_COMMON_NAME) - private String commonName; - - public static final String SERIALIZED_NAME_DNS_NAMES = "dnsNames"; - - @SerializedName(SERIALIZED_NAME_DNS_NAMES) - private List dnsNames = new ArrayList(); - - public static final String SERIALIZED_NAME_ISSUER_REF = "issuerRef"; - - @SerializedName(SERIALIZED_NAME_ISSUER_REF) - private V1beta1OrderSpecIssuerRef issuerRef; - - public static final String SERIALIZED_NAME_REQUEST = "request"; - - @SerializedName(SERIALIZED_NAME_REQUEST) - private byte[] request; - - public V1beta1OrderSpec commonName(String commonName) { - - this.commonName = commonName; - return this; - } - - /** - * CommonName is the common name as specified on the DER encoded CSR. If specified, this value - * must also be present in `dnsNames`. This field must match the corresponding field on - * the DER encoded CSR. - * - * @return commonName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "CommonName is the common name as specified on the DER encoded CSR. If specified, this value must also be present in `dnsNames`. This field must match the corresponding field on the DER encoded CSR.") - public String getCommonName() { - return commonName; - } - - public void setCommonName(String commonName) { - this.commonName = commonName; - } - - public V1beta1OrderSpec dnsNames(List dnsNames) { - - this.dnsNames = dnsNames; - return this; - } - - public V1beta1OrderSpec addDnsNamesItem(String dnsNamesItem) { - this.dnsNames.add(dnsNamesItem); - return this; - } - - /** - * DNSNames is a list of DNS names that should be included as part of the Order validation - * process. This field must match the corresponding field on the DER encoded CSR. - * - * @return dnsNames - */ - @ApiModelProperty( - required = true, - value = - "DNSNames is a list of DNS names that should be included as part of the Order validation process. This field must match the corresponding field on the DER encoded CSR.") - public List getDnsNames() { - return dnsNames; - } - - public void setDnsNames(List dnsNames) { - this.dnsNames = dnsNames; - } - - public V1beta1OrderSpec issuerRef(V1beta1OrderSpecIssuerRef issuerRef) { - - this.issuerRef = issuerRef; - return this; - } - - /** - * Get issuerRef - * - * @return issuerRef - */ - @ApiModelProperty(required = true, value = "") - public V1beta1OrderSpecIssuerRef getIssuerRef() { - return issuerRef; - } - - public void setIssuerRef(V1beta1OrderSpecIssuerRef issuerRef) { - this.issuerRef = issuerRef; - } - - public V1beta1OrderSpec request(byte[] request) { - - this.request = request; - return this; - } - - /** - * Certificate signing request bytes in DER encoding. This will be used when finalizing the order. - * This field must be set on the order. - * - * @return request - */ - @ApiModelProperty( - required = true, - value = - "Certificate signing request bytes in DER encoding. This will be used when finalizing the order. This field must be set on the order.") - public byte[] getRequest() { - return request; - } - - public void setRequest(byte[] request) { - this.request = request; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderSpec v1beta1OrderSpec = (V1beta1OrderSpec) o; - return Objects.equals(this.commonName, v1beta1OrderSpec.commonName) - && Objects.equals(this.dnsNames, v1beta1OrderSpec.dnsNames) - && Objects.equals(this.issuerRef, v1beta1OrderSpec.issuerRef) - && Arrays.equals(this.request, v1beta1OrderSpec.request); - } - - @Override - public int hashCode() { - return Objects.hash(commonName, dnsNames, issuerRef, Arrays.hashCode(request)); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderSpec {\n"); - sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); - sb.append(" dnsNames: ").append(toIndentedString(dnsNames)).append("\n"); - sb.append(" issuerRef: ").append(toIndentedString(issuerRef)).append("\n"); - sb.append(" request: ").append(toIndentedString(request)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java deleted file mode 100644 index 5749999496..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderSpecIssuerRef.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * IssuerRef references a properly configured ACME-type Issuer which should be used to create this - * Order. If the Issuer does not exist, processing will be retried. If the Issuer is not an - * 'ACME' Issuer, an error will be returned and the Order will be marked as failed. - */ -@ApiModel( - description = - "IssuerRef references a properly configured ACME-type Issuer which should be used to create this Order. If the Issuer does not exist, processing will be retried. If the Issuer is not an 'ACME' Issuer, an error will be returned and the Order will be marked as failed.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderSpecIssuerRef { - public static final String SERIALIZED_NAME_GROUP = "group"; - - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_KIND = "kind"; - - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public V1beta1OrderSpecIssuerRef group(String group) { - - this.group = group; - return this; - } - - /** - * Group of the resource being referred to. - * - * @return group - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Group of the resource being referred to.") - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public V1beta1OrderSpecIssuerRef kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind of the resource being referred to. - * - * @return kind - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind of the resource being referred to.") - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } - - public V1beta1OrderSpecIssuerRef name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the resource being referred to. - * - * @return name - */ - @ApiModelProperty(required = true, value = "Name of the resource being referred to.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderSpecIssuerRef v1beta1OrderSpecIssuerRef = (V1beta1OrderSpecIssuerRef) o; - return Objects.equals(this.group, v1beta1OrderSpecIssuerRef.group) - && Objects.equals(this.kind, v1beta1OrderSpecIssuerRef.kind) - && Objects.equals(this.name, v1beta1OrderSpecIssuerRef.name); - } - - @Override - public int hashCode() { - return Objects.hash(group, kind, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderSpecIssuerRef {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java deleted file mode 100644 index 3231ee380d..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatus.java +++ /dev/null @@ -1,353 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -/** V1beta1OrderStatus */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderStatus { - public static final String SERIALIZED_NAME_AUTHORIZATIONS = "authorizations"; - - @SerializedName(SERIALIZED_NAME_AUTHORIZATIONS) - private List authorizations = null; - - public static final String SERIALIZED_NAME_CERTIFICATE = "certificate"; - - @SerializedName(SERIALIZED_NAME_CERTIFICATE) - private byte[] certificate; - - public static final String SERIALIZED_NAME_FAILURE_TIME = "failureTime"; - - @SerializedName(SERIALIZED_NAME_FAILURE_TIME) - private OffsetDateTime failureTime; - - public static final String SERIALIZED_NAME_FINALIZE_U_R_L = "finalizeURL"; - - @SerializedName(SERIALIZED_NAME_FINALIZE_U_R_L) - private String finalizeURL; - - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - /** - * State contains the current state of this Order resource. States 'success' and - * 'expired' are 'final' - */ - @JsonAdapter(StateEnum.Adapter.class) - public enum StateEnum { - VALID("valid"), - - READY("ready"), - - PENDING("pending"), - - PROCESSING("processing"), - - INVALID("invalid"), - - EXPIRED("expired"), - - ERRORED("errored"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StateEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StateEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATE = "state"; - - @SerializedName(SERIALIZED_NAME_STATE) - private StateEnum state; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public V1beta1OrderStatus authorizations(List authorizations) { - - this.authorizations = authorizations; - return this; - } - - public V1beta1OrderStatus addAuthorizationsItem( - V1beta1OrderStatusAuthorizations authorizationsItem) { - if (this.authorizations == null) { - this.authorizations = new ArrayList(); - } - this.authorizations.add(authorizationsItem); - return this; - } - - /** - * Authorizations contains data returned from the ACME server on what authorizations must be - * completed in order to validate the DNS names specified on the Order. - * - * @return authorizations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Authorizations contains data returned from the ACME server on what authorizations must be completed in order to validate the DNS names specified on the Order.") - public List getAuthorizations() { - return authorizations; - } - - public void setAuthorizations(List authorizations) { - this.authorizations = authorizations; - } - - public V1beta1OrderStatus certificate(byte[] certificate) { - - this.certificate = certificate; - return this; - } - - /** - * Certificate is a copy of the PEM encoded certificate for this Order. This field will be - * populated after the order has been successfully finalized with the ACME server, and the order - * has transitioned to the 'valid' state. - * - * @return certificate - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Certificate is a copy of the PEM encoded certificate for this Order. This field will be populated after the order has been successfully finalized with the ACME server, and the order has transitioned to the 'valid' state.") - public byte[] getCertificate() { - return certificate; - } - - public void setCertificate(byte[] certificate) { - this.certificate = certificate; - } - - public V1beta1OrderStatus failureTime(OffsetDateTime failureTime) { - - this.failureTime = failureTime; - return this; - } - - /** - * FailureTime stores the time that this order failed. This is used to influence garbage - * collection and back-off. - * - * @return failureTime - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "FailureTime stores the time that this order failed. This is used to influence garbage collection and back-off.") - public OffsetDateTime getFailureTime() { - return failureTime; - } - - public void setFailureTime(OffsetDateTime failureTime) { - this.failureTime = failureTime; - } - - public V1beta1OrderStatus finalizeURL(String finalizeURL) { - - this.finalizeURL = finalizeURL; - return this; - } - - /** - * FinalizeURL of the Order. This is used to obtain certificates for this order once it has been - * completed. - * - * @return finalizeURL - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "FinalizeURL of the Order. This is used to obtain certificates for this order once it has been completed.") - public String getFinalizeURL() { - return finalizeURL; - } - - public void setFinalizeURL(String finalizeURL) { - this.finalizeURL = finalizeURL; - } - - public V1beta1OrderStatus reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * Reason optionally provides more information about a why the order is in the current state. - * - * @return reason - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Reason optionally provides more information about a why the order is in the current state.") - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public V1beta1OrderStatus state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * State contains the current state of this Order resource. States 'success' and - * 'expired' are 'final' - * - * @return state - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "State contains the current state of this Order resource. States 'success' and 'expired' are 'final'") - public StateEnum getState() { - return state; - } - - public void setState(StateEnum state) { - this.state = state; - } - - public V1beta1OrderStatus url(String url) { - - this.url = url; - return this; - } - - /** - * URL of the Order. This will initially be empty when the resource is first created. The Order - * controller will populate this field when the Order is first processed. This field will be - * immutable after it is initially set. - * - * @return url - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "URL of the Order. This will initially be empty when the resource is first created. The Order controller will populate this field when the Order is first processed. This field will be immutable after it is initially set.") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderStatus v1beta1OrderStatus = (V1beta1OrderStatus) o; - return Objects.equals(this.authorizations, v1beta1OrderStatus.authorizations) - && Arrays.equals(this.certificate, v1beta1OrderStatus.certificate) - && Objects.equals(this.failureTime, v1beta1OrderStatus.failureTime) - && Objects.equals(this.finalizeURL, v1beta1OrderStatus.finalizeURL) - && Objects.equals(this.reason, v1beta1OrderStatus.reason) - && Objects.equals(this.state, v1beta1OrderStatus.state) - && Objects.equals(this.url, v1beta1OrderStatus.url); - } - - @Override - public int hashCode() { - return Objects.hash( - authorizations, Arrays.hashCode(certificate), failureTime, finalizeURL, reason, state, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderStatus {\n"); - sb.append(" authorizations: ").append(toIndentedString(authorizations)).append("\n"); - sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); - sb.append(" failureTime: ").append(toIndentedString(failureTime)).append("\n"); - sb.append(" finalizeURL: ").append(toIndentedString(finalizeURL)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java deleted file mode 100644 index 3c7362fb55..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusAuthorizations.java +++ /dev/null @@ -1,303 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * ACMEAuthorization contains data returned from the ACME server on an authorization that must be - * completed in order validate a DNS name on an ACME Order resource. - */ -@ApiModel( - description = - "ACMEAuthorization contains data returned from the ACME server on an authorization that must be completed in order validate a DNS name on an ACME Order resource.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderStatusAuthorizations { - public static final String SERIALIZED_NAME_CHALLENGES = "challenges"; - - @SerializedName(SERIALIZED_NAME_CHALLENGES) - private List challenges = null; - - public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; - - @SerializedName(SERIALIZED_NAME_IDENTIFIER) - private String identifier; - - /** - * InitialState is the initial state of the ACME authorization when first fetched from the ACME - * server. If an Authorization is already 'valid', the Order controller will not create a - * Challenge resource for the authorization. This will occur when working with an ACME server that - * enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set - * and 'identifier' is set, the state is assumed to be pending and a Challenge will be - * created. - */ - @JsonAdapter(InitialStateEnum.Adapter.class) - public enum InitialStateEnum { - VALID("valid"), - - READY("ready"), - - PENDING("pending"), - - PROCESSING("processing"), - - INVALID("invalid"), - - EXPIRED("expired"), - - ERRORED("errored"); - - private String value; - - InitialStateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static InitialStateEnum fromValue(String value) { - for (InitialStateEnum b : InitialStateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final InitialStateEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public InitialStateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return InitialStateEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; - - @SerializedName(SERIALIZED_NAME_INITIAL_STATE) - private InitialStateEnum initialState; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public static final String SERIALIZED_NAME_WILDCARD = "wildcard"; - - @SerializedName(SERIALIZED_NAME_WILDCARD) - private Boolean wildcard; - - public V1beta1OrderStatusAuthorizations challenges( - List challenges) { - - this.challenges = challenges; - return this; - } - - public V1beta1OrderStatusAuthorizations addChallengesItem( - V1beta1OrderStatusChallenges challengesItem) { - if (this.challenges == null) { - this.challenges = new ArrayList(); - } - this.challenges.add(challengesItem); - return this; - } - - /** - * Challenges specifies the challenge types offered by the ACME server. One of these challenge - * types will be selected when validating the DNS name and an appropriate Challenge resource will - * be created to perform the ACME challenge process. - * - * @return challenges - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Challenges specifies the challenge types offered by the ACME server. One of these challenge types will be selected when validating the DNS name and an appropriate Challenge resource will be created to perform the ACME challenge process.") - public List getChallenges() { - return challenges; - } - - public void setChallenges(List challenges) { - this.challenges = challenges; - } - - public V1beta1OrderStatusAuthorizations identifier(String identifier) { - - this.identifier = identifier; - return this; - } - - /** - * Identifier is the DNS name to be validated as part of this authorization - * - * @return identifier - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Identifier is the DNS name to be validated as part of this authorization") - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public V1beta1OrderStatusAuthorizations initialState(InitialStateEnum initialState) { - - this.initialState = initialState; - return this; - } - - /** - * InitialState is the initial state of the ACME authorization when first fetched from the ACME - * server. If an Authorization is already 'valid', the Order controller will not create a - * Challenge resource for the authorization. This will occur when working with an ACME server that - * enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set - * and 'identifier' is set, the state is assumed to be pending and a Challenge will be - * created. - * - * @return initialState - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "InitialState is the initial state of the ACME authorization when first fetched from the ACME server. If an Authorization is already 'valid', the Order controller will not create a Challenge resource for the authorization. This will occur when working with an ACME server that enables 'authz reuse' (such as Let's Encrypt's production endpoint). If not set and 'identifier' is set, the state is assumed to be pending and a Challenge will be created.") - public InitialStateEnum getInitialState() { - return initialState; - } - - public void setInitialState(InitialStateEnum initialState) { - this.initialState = initialState; - } - - public V1beta1OrderStatusAuthorizations url(String url) { - - this.url = url; - return this; - } - - /** - * URL is the URL of the Authorization that must be completed - * - * @return url - */ - @ApiModelProperty( - required = true, - value = "URL is the URL of the Authorization that must be completed") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public V1beta1OrderStatusAuthorizations wildcard(Boolean wildcard) { - - this.wildcard = wildcard; - return this; - } - - /** - * Wildcard will be true if this authorization is for a wildcard DNS name. If this is true, the - * identifier will be the *non-wildcard* version of the DNS name. For example, if - * '*.example.com' is the DNS name being validated, this field will be 'true' and - * the 'identifier' field will be 'example.com'. - * - * @return wildcard - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Wildcard will be true if this authorization is for a wildcard DNS name. If this is true, the identifier will be the *non-wildcard* version of the DNS name. For example, if '*.example.com' is the DNS name being validated, this field will be 'true' and the 'identifier' field will be 'example.com'.") - public Boolean getWildcard() { - return wildcard; - } - - public void setWildcard(Boolean wildcard) { - this.wildcard = wildcard; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderStatusAuthorizations v1beta1OrderStatusAuthorizations = - (V1beta1OrderStatusAuthorizations) o; - return Objects.equals(this.challenges, v1beta1OrderStatusAuthorizations.challenges) - && Objects.equals(this.identifier, v1beta1OrderStatusAuthorizations.identifier) - && Objects.equals(this.initialState, v1beta1OrderStatusAuthorizations.initialState) - && Objects.equals(this.url, v1beta1OrderStatusAuthorizations.url) - && Objects.equals(this.wildcard, v1beta1OrderStatusAuthorizations.wildcard); - } - - @Override - public int hashCode() { - return Objects.hash(challenges, identifier, initialState, url, wildcard); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderStatusAuthorizations {\n"); - sb.append(" challenges: ").append(toIndentedString(challenges)).append("\n"); - sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); - sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" wildcard: ").append(toIndentedString(wildcard)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java b/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java deleted file mode 100644 index d2c79b1ae6..0000000000 --- a/client-java-contrib/cert-manager/src/main/java/io/cert/manager/models/V1beta1OrderStatusChallenges.java +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.cert.manager.models; - -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; - -/** - * Challenge specifies a challenge offered by the ACME server for an Order. An appropriate Challenge - * resource can be created to perform the ACME challenge process. - */ -@ApiModel( - description = - "Challenge specifies a challenge offered by the ACME server for an Order. An appropriate Challenge resource can be created to perform the ACME challenge process.") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2020-08-18T19:55:23.947Z[Etc/UTC]") -public class V1beta1OrderStatusChallenges { - public static final String SERIALIZED_NAME_TOKEN = "token"; - - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - private String url; - - public V1beta1OrderStatusChallenges token(String token) { - - this.token = token; - return this; - } - - /** - * Token is the token that must be presented for this challenge. This is used to compute the - * 'key' that must also be presented. - * - * @return token - */ - @ApiModelProperty( - required = true, - value = - "Token is the token that must be presented for this challenge. This is used to compute the 'key' that must also be presented.") - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public V1beta1OrderStatusChallenges type(String type) { - - this.type = type; - return this; - } - - /** - * Type is the type of challenge being offered, e.g. 'http-01', 'dns-01', - * 'tls-sni-01', etc. This is the raw value retrieved from the ACME server. Only - * 'http-01' and 'dns-01' are supported by cert-manager, other values will be - * ignored. - * - * @return type - */ - @ApiModelProperty( - required = true, - value = - "Type is the type of challenge being offered, e.g. 'http-01', 'dns-01', 'tls-sni-01', etc. This is the raw value retrieved from the ACME server. Only 'http-01' and 'dns-01' are supported by cert-manager, other values will be ignored.") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public V1beta1OrderStatusChallenges url(String url) { - - this.url = url; - return this; - } - - /** - * URL is the URL of this challenge. It can be used to retrieve additional metadata about the - * Challenge from the ACME server. - * - * @return url - */ - @ApiModelProperty( - required = true, - value = - "URL is the URL of this challenge. It can be used to retrieve additional metadata about the Challenge from the ACME server.") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1beta1OrderStatusChallenges v1beta1OrderStatusChallenges = (V1beta1OrderStatusChallenges) o; - return Objects.equals(this.token, v1beta1OrderStatusChallenges.token) - && Objects.equals(this.type, v1beta1OrderStatusChallenges.type) - && Objects.equals(this.url, v1beta1OrderStatusChallenges.url); - } - - @Override - public int hashCode() { - return Objects.hash(token, type, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1beta1OrderStatusChallenges {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy deleted file mode 100644 index 054e3cd37e..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/basic/CoreV1ApiTest.groovy +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.basic - -import io.kubernetes.client.openapi.Configuration -import io.kubernetes.client.openapi.apis.CoreV1Api -import io.kubernetes.client.openapi.models.V1Namespace -import io.kubernetes.client.openapi.models.V1ObjectMeta -import io.kubernetes.client.openapi.models.V1Status -import io.kubernetes.client.util.ClientBuilder -import spock.lang.Specification - -class CoreV1ApiTest extends Specification { - def "Create Namespace then Delete should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - def corev1api = new CoreV1Api(apiClient) - Configuration.setDefaultApiClient(apiClient) - def namespaceFoo = new V1Namespace().metadata(new V1ObjectMeta().name("e2e-basic")) - when: - V1Namespace created = corev1api.createNamespace(namespaceFoo, null, null, null, null) - then: - created != null - when: - V1Status deleted = corev1api.deleteNamespace("e2e-basic", null, null, null, null, null, null, null) - then: - deleted != null - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy deleted file mode 100644 index 37ea52660b..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/csr/CSRTest.groovy +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.csr - -import java.security.KeyPairGenerator -import java.security.SecureRandom - -import io.kubernetes.client.openapi.ApiClient -import io.kubernetes.client.openapi.models.V1CertificateSigningRequest -import io.kubernetes.client.util.CSRUtils -import io.kubernetes.client.util.ClientBuilder -import io.kubernetes.client.util.version.Version -import spock.lang.Specification -import spock.util.concurrent.PollingConditions - -class CSRTest extends Specification { - def "Build client instance via CSR should work"() { - // initialize test environment - given: - KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA") - keyGen.initialize(2048, new SecureRandom()) - ApiClient bootstrapApiClient = ClientBuilder.defaultClient() - - // generating key-pair - when: - def keyPair = keyGen.generateKeyPair() - then: - keyPair != null - - // sign new CSR - when: - def csrBytes = CSRUtils.sign(keyPair, "foo") - then: - csrBytes != null - - // creates CSR object against cluster - when: - def newCsr = CSRUtils.newV1CertificateSigningRequest("foo", csrBytes) - def created = CSRUtils.createIfAbsent(bootstrapApiClient, newCsr) - then: - created - - // reload certificates from CSR - when: - CSRUtils.approve(bootstrapApiClient, "foo") - def signedApiClient = ClientBuilder.fromCertificateSigningRequest(bootstrapApiClient, keyPair.getPrivate(), newCsr) - then: - signedApiClient != null - - // use the new client to get "/version" - when: - def v = new Version(signedApiClient).getVersion() - then: - v != null - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy deleted file mode 100644 index 0a47219210..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/dynamic/DynamicApiTest.groovy +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.dynamic - - -import io.kubernetes.client.openapi.models.V1Namespace -import io.kubernetes.client.openapi.models.V1ObjectMeta -import io.kubernetes.client.util.ClientBuilder -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi -import io.kubernetes.client.util.generic.dynamic.Dynamics -import spock.lang.Specification - -class DynamicApiTest extends Specification { - def "Create Namespace then Delete should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - def dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient) - def namespaceFoo = new V1Namespace().metadata(new V1ObjectMeta().name("e2e-dynamic")) - when: - def createdNamespace = dynamicApi.create(Dynamics.newFromJson(apiClient.getJSON().serialize(namespaceFoo))) - then: - createdNamespace != null - when: - def deleted = dynamicApi.delete("e2e-dynamic").throwsApiException().getObject() - then: - deleted != null - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy deleted file mode 100644 index 4ffe3dce4a..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/informer/NamespaceInformerTest.groovy +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.informer - -import io.kubernetes.client.informer.SharedInformerFactory -import io.kubernetes.client.informer.cache.Lister -import io.kubernetes.client.openapi.models.V1Namespace -import io.kubernetes.client.openapi.models.V1NamespaceList -import io.kubernetes.client.util.ClientBuilder -import io.kubernetes.client.util.generic.GenericKubernetesApi -import spock.lang.Specification -import spock.util.concurrent.PollingConditions - -class NamespaceInformerTest extends Specification { - - def "list-watching namespaces should work"() { - given: - def conditions = new PollingConditions() - def apiClient = ClientBuilder.defaultClient() - def api = new GenericKubernetesApi( - V1Namespace.class, - V1NamespaceList.class, - "", - "v1", - "namespaces", - apiClient) - def informerFactory = new SharedInformerFactory() - def nsInformer = informerFactory.sharedIndexInformerFor( - api, - V1Namespace.class, - 0) - def nsLister = new Lister(nsInformer.getIndexer()) - when: - informerFactory.startAllRegisteredInformers() - then: - conditions.eventually { - nsInformer.hasSynced() - nsLister.list().size() > 0 - } - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy deleted file mode 100644 index 759263cf65..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlDrainTest.groovy +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.kubectl - -import io.kubernetes.client.extended.kubectl.Kubectl -import io.kubernetes.client.extended.kubectl.exception.KubectlException -import io.kubernetes.client.openapi.ApiException -import io.kubernetes.client.openapi.Configuration -import io.kubernetes.client.openapi.models.V1Container -import io.kubernetes.client.openapi.models.V1Node -import io.kubernetes.client.openapi.models.V1ObjectMeta -import io.kubernetes.client.openapi.models.V1Pod -import io.kubernetes.client.openapi.models.V1PodSpec -import io.kubernetes.client.util.ClientBuilder -import spock.lang.Specification - -class KubectlDrainTest extends Specification { - def "Kubectl drain should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - Configuration.setDefaultApiClient(apiClient) - def testNode = new V1Node() - .metadata(new V1ObjectMeta().name("foo")) - def testPod = new V1Pod() - .metadata(new V1ObjectMeta() - .namespace("default") - .name("bar")) - .spec(new V1PodSpec() - .nodeName("foo") - .containers(Arrays.asList( - new V1Container().name("c1").image("nginx") - ))) - when: - V1Node createdNode = Kubectl.create(V1Node.class).resource(testNode).execute() - V1Pod createdPod = Kubectl.create(V1Pod.class).resource(testPod).execute() - then: - createdNode != null - createdPod != null - when: - V1Node drainedNode = Kubectl.drain().gracePeriod(0).name("foo").execute() - then: - drainedNode != null - when: - Kubectl.get(V1Pod.class).namespace("default").name("bar").execute() - then: - def e = thrown KubectlException - e.getCause().class == ApiException.class - cleanup: - Kubectl.delete(V1Node.class).name("foo").execute() - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy deleted file mode 100644 index 55a719ffd6..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlNamespaceTest.groovy +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.kubectl - -import io.kubernetes.client.extended.kubectl.Kubectl -import io.kubernetes.client.openapi.models.V1Namespace -import io.kubernetes.client.openapi.models.V1ObjectMeta -import io.kubernetes.client.util.ClientBuilder -import spock.lang.Specification - -class KubectlNamespaceTest extends Specification { - - def "Kubectl manipulating namespace should work"() { - given: - def apiClient = ClientBuilder.defaultClient(); - - when: - def createdNamespace = Kubectl.create(V1Namespace.class) - .apiClient(apiClient) - .resource(new V1Namespace() - .apiVersion("v1") - .metadata( - new V1ObjectMeta() - .name("foo"))) - .execute() - then: - createdNamespace != null - Kubectl.get(V1Namespace.class) - .apiClient(apiClient) - .name("foo") - .execute() != null - - when: - def appliedNamespace = Kubectl.apply(V1Namespace.class) - .apiClient(apiClient) - .resource(new V1Namespace() - .apiVersion("v1") - .kind("Namespace") - .metadata(new V1ObjectMeta() - .name("foo") - .putAnnotationsItem("k", "v"))) - .execute() - then: - appliedNamespace != null - Kubectl.get(V1Namespace.class) - .apiClient(apiClient) - .name("foo") - .execute().metadata.getAnnotations().get("k") == "v" - - when: - def replacedNamespace = Kubectl.replace(V1Namespace.class) - .apiClient(apiClient) - .resource(new V1Namespace() - .apiVersion("v1") - .kind("Namespace") - .metadata(new V1ObjectMeta() - .name("foo") - .putAnnotationsItem("k", "v2"))) - .execute() - then: - replacedNamespace != null - Kubectl.get(V1Namespace.class) - .apiClient(apiClient) - .name("foo") - .execute().metadata.getAnnotations().get("k") == "v2" - - when: - def deletedNamespace = Kubectl.delete(V1Namespace.class) - .apiClient(apiClient) - .name("foo") - .execute() - then: - deletedNamespace != null - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy deleted file mode 100644 index 83b3413eea..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/kubectl/KubectlRolloutTest.groovy +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.kubectl - -import java.nio.charset.StandardCharsets -import java.time.Duration - -import org.awaitility.Awaitility - -import io.kubernetes.client.extended.kubectl.Kubectl -import io.kubernetes.client.openapi.Configuration -import io.kubernetes.client.openapi.models.V1DaemonSet -import io.kubernetes.client.openapi.models.V1Deployment -import io.kubernetes.client.openapi.models.V1StatefulSet -import io.kubernetes.client.util.ClientBuilder -import io.kubernetes.client.util.Streams -import io.kubernetes.client.util.Yaml -import spock.lang.Specification - -class KubectlRolloutTest extends Specification { - - def "Kubectl rollout daemonset should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - Configuration.setDefaultApiClient(apiClient) - // initial daemonset has only one container - def daemonSet = Yaml.load(getResourceFileAsString("test-daemonset.yaml")) - // updating daemonset has two containers - def updatingDaemonSet = Yaml.load(getResourceFileAsString("test-daemonset-updated.yaml")) - - when: - def createdDaemonSet = Kubectl.create(V1DaemonSet.class) - .resource(daemonSet) - .execute() - then: - createdDaemonSet != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1DaemonSet.class) - .history() - .namespace(daemonSet.metadata.namespace) - .name(daemonSet.metadata.name) - .execute() - .size() == 1 - } - - when: - def updatedDaemonSet = Kubectl.replace(V1DaemonSet.class) - .resource(updatingDaemonSet) - .execute() - then: - updatedDaemonSet != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1DaemonSet.class) - .history() - .namespace(daemonSet.metadata.namespace) - .name(daemonSet.metadata.name) - .execute() - .size() == 2 - } - Kubectl.rollout(V1DaemonSet.class) - .history() - .revision(2) - .namespace(daemonSet.metadata.namespace) - .name(daemonSet.metadata.name) - .execute() - .spec.containers.size() == 2 - - cleanup: - Kubectl.delete(V1DaemonSet.class) - .namespace(daemonSet.metadata.namespace) - .name(daemonSet.metadata.name) - .execute() - } - - - def "Kubectl rollout deployment should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - Configuration.setDefaultApiClient(apiClient) - // initial deployment has only one container - def deployment = Yaml.load(getResourceFileAsString("test-deployment.yaml")) - // updating deployment has two containers - def updatingDeployment = Yaml.load(getResourceFileAsString("test-deployment-updated.yaml")) - - when: - def createdDeployment = Kubectl.create(V1Deployment.class) - .resource(deployment) - .execute() - then: - createdDeployment != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1Deployment.class) - .history() - .namespace(deployment.metadata.namespace) - .name(deployment.metadata.name) - .execute() - .size() == 1 - } - - when: - def updatedDaemonSet = Kubectl.replace(V1Deployment.class) - .resource(updatingDeployment) - .execute() - then: - updatedDaemonSet != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1Deployment.class) - .history() - .namespace(deployment.metadata.namespace) - .name(deployment.metadata.name) - .execute() - .size() == 2 - } - Kubectl.rollout(V1Deployment.class) - .history() - .revision(2) - .namespace(deployment.metadata.namespace) - .name(deployment.metadata.name) - .execute() - .spec.containers.size() == 2 - - cleanup: - Kubectl.delete(V1Deployment.class) - .namespace(deployment.metadata.namespace) - .name(deployment.metadata.name) - .execute() - } - - - def "Kubectl rollout statefulset should work"() { - given: - def apiClient = ClientBuilder.defaultClient() - Configuration.setDefaultApiClient(apiClient) - // initial deployment has only one container - def statefulset = Yaml.load(getResourceFileAsString("test-statefulset.yaml")) - // updating deployment has two containers - def updatingStatefulSet = Yaml.load(getResourceFileAsString("test-statefulset-updated.yaml")) - - when: - def createdStatefulSet = Kubectl.create(V1StatefulSet.class) - .resource(statefulset) - .execute() - then: - createdStatefulSet != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1StatefulSet.class) - .history() - .namespace(statefulset.metadata.namespace) - .name(statefulset.metadata.name) - .execute() - .size() == 1 - } - - when: - def updatedDaemonSet = Kubectl.replace(V1StatefulSet.class) - .resource(updatingStatefulSet) - .execute() - then: - updatedDaemonSet != null - Awaitility.await() - .pollInterval(Duration.ofSeconds(1)) - .atMost(Duration.ofSeconds(3)) - .until{ - -> Kubectl.rollout(V1StatefulSet.class) - .history() - .namespace(statefulset.metadata.namespace) - .name(statefulset.metadata.name) - .execute() - .size() == 2 - } - Kubectl.rollout(V1StatefulSet.class) - .history() - .revision(2) - .namespace(statefulset.metadata.namespace) - .name(statefulset.metadata.name) - .execute() - .spec.containers.size() == 2 - - cleanup: - Kubectl.delete(V1StatefulSet.class) - .namespace(statefulset.metadata.namespace) - .name(statefulset.metadata.name) - .execute() - } - - - private String getResourceFileAsString(String filename) { - def url = this.getClass().getClassLoader().getResource(filename) - return Streams.toString(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8)); - } -} diff --git a/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy b/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy deleted file mode 100644 index eb57310328..0000000000 --- a/e2e/src/test/groovy/io/kubernetes/client/e2e/util/ModelMapperTest.groovy +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.e2e.util - -import io.kubernetes.client.Discovery -import io.kubernetes.client.apimachinery.GroupVersionKind -import io.kubernetes.client.apimachinery.GroupVersionResource -import io.kubernetes.client.openapi.models.V1CustomResourceDefinition -import io.kubernetes.client.openapi.models.V1Deployment -import io.kubernetes.client.openapi.models.V1Pod -import io.kubernetes.client.util.ClientBuilder -import io.kubernetes.client.util.ModelMapper -import spock.lang.Specification - -class ModelMapperTest extends Specification { - - def "api-discovery should work"() { - given: - def apiClient = ClientBuilder.defaultClient(); - def discovery = new Discovery(apiClient) - ModelMapper.refresh(discovery); - - expect: - new GroupVersionKind("", "v1", "Pod") == ModelMapper.getGroupVersionKindByClass(V1Pod.class) - new GroupVersionResource("", "v1", "pods") == ModelMapper.getGroupVersionResourceByClass(V1Pod.class) - ModelMapper.isNamespaced(V1Pod.class) - - new GroupVersionKind("apps", "v1", "Deployment") == ModelMapper.getGroupVersionKindByClass(V1Deployment.class) - new GroupVersionResource("apps", "v1", "deployments") == ModelMapper.getGroupVersionResourceByClass(V1Deployment.class) - ModelMapper.isNamespaced(V1Deployment.class) - - new GroupVersionKind("apiextensions.k8s.io", "v1", "CustomResourceDefinition") == ModelMapper.getGroupVersionKindByClass(V1CustomResourceDefinition.class) - new GroupVersionResource("apiextensions.k8s.io", "v1", "customresourcedefinitions") == ModelMapper.getGroupVersionResourceByClass(V1CustomResourceDefinition.class) - !ModelMapper.isNamespaced(V1CustomResourceDefinition.class) - } -} diff --git a/examples/examples-release-16/Dockerfile b/examples/examples-release-16/Dockerfile deleted file mode 100644 index ac90eb1d67..0000000000 --- a/examples/examples-release-16/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8-jre - -COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar - -CMD ["java", "-jar", "/examples.jar"] - - diff --git a/examples/examples-release-16/README.md b/examples/examples-release-16/README.md deleted file mode 100644 index 98a3dee175..0000000000 --- a/examples/examples-release-16/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Running examples - -```sh -export REPO_ROOT=/path/to/client-java/repo - -cd ${REPO_ROOT}/ -mvn install - -cd ${REPO_ROOT}/examples/examples-13 -mvn compile -mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" -``` - diff --git a/examples/examples-release-16/createPod.sh b/examples/examples-release-16/createPod.sh deleted file mode 100755 index 18a9841317..0000000000 --- a/examples/examples-release-16/createPod.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# creates a pod and runs -# Example.java(list pods for all namespaces) on starting of pod - -# Exit on any error. -set -e - -if ! which minikube > /dev/null; then - echo "This script requires minikube installed." - exit 100 -fi - -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -export REPO_ROOT=${dir}/.. - -cd ${REPO_ROOT} -mvn install - -cd ${REPO_ROOT}/examples -mvn package - -eval $(minikube docker-env) -docker build -t test/examples:1.0 . -kubectl apply -f test.yaml diff --git a/examples/examples-release-16/pom.xml b/examples/examples-release-16/pom.xml deleted file mode 100644 index 154a5e9639..0000000000 --- a/examples/examples-release-16/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - 4.0.0 - - - io.kubernetes - client-java-examples-parent - 25.0.0-legacy-SNAPSHOT - .. - - - client-java-examples-release-16 - client-java-examples-release-16 - - - - ch.qos.logback - logback-classic - runtime - - - io.prometheus - simpleclient - 0.16.0 - - - io.prometheus - simpleclient_httpserver - 0.16.0 - - - io.kubernetes - client-java-api - 16.0.0 - - - io.kubernetes - client-java - 16.0.0 - - - io.kubernetes - client-java-extended - 16.0.0 - - - io.kubernetes - client-java-spring-integration - 16.0.0 - - - io.kubernetes - client-java-proto - 16.0.0 - - - commons-cli - commons-cli - - - io.kubernetes - client-java-cert-manager-models - 10.0.1 - - - io.kubernetes - client-java-prometheus-operator-models - 10.0.1 - - - - junit - junit - test - - - com.github.tomakehurst - wiremock - test - - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-actuator - ${spring.boot.version} - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - 3.1.4 - - true - - - - - - \ No newline at end of file diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java deleted file mode 100644 index 7f753b8d8f..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/AttachExample.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Attach; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" - * - *

From inside $REPO_DIR/examples - */ -public class AttachExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Attach attach = new Attach(); - final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); - - new Thread( - new Runnable() { - public void run() { - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - OutputStream output = result.getStandardInputStream(); - try { - while (true) { - String line = in.readLine(); - output.write(line.getBytes()); - output.write('\n'); - output.flush(); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getStandardOutputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - result.close(); - System.exit(0); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java deleted file mode 100644 index b616a18ee9..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CertManagerExample.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; -import io.cert.manager.models.V1beta1Issuer; -import io.cert.manager.models.V1beta1IssuerList; -import io.cert.manager.models.V1beta1IssuerSpec; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -/** - * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a - * Kubernetes cluster where cert-manager is installed - */ -public class CertManagerExample { - public static void main(String[] args) throws IOException { - GenericKubernetesApi issuerApi = - new GenericKubernetesApi<>( - V1beta1Issuer.class, - V1beta1IssuerList.class, - "cert-manager.io", - "v1beta1", - "issuers", - ClientBuilder.defaultClient()); - issuerApi.create( - new V1beta1Issuer() - .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) - .kind("Issuer") - .apiVersion("cert-manager.io/v1beta1") - .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java deleted file mode 100644 index fed0e544d3..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ControllerExample.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.ControllerManager; -import io.kubernetes.client.extended.controller.LeaderElectingController; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.extended.event.EventType; -import io.kubernetes.client.extended.event.legacy.EventBroadcaster; -import io.kubernetes.client.extended.event.legacy.EventRecorder; -import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1EventSource; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.util.CallGeneratorParams; -import java.io.IOException; -import java.time.Duration; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -public class ControllerExample { - public static void main(String[] args) throws IOException { - - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - // instantiating an informer-factory, and there should be only one informer-factory - // globally. - SharedInformerFactory informerFactory = new SharedInformerFactory(); - // registering node-informer into the informer-factory. - SharedIndexInformer nodeInformer = - informerFactory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - informerFactory.startAllRegisteredInformers(); - - EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); - - // nodeReconciler prints node information on events - NodePrintingReconciler nodeReconciler = - new NodePrintingReconciler( - nodeInformer, - eventBroadcaster.newRecorder( - new V1EventSource().host("localhost").component("node-printer"))); - - // Use builder library to construct a default controller. - Controller controller = - ControllerBuilder.defaultBuilder(informerFactory) - .watch( - (workQueue) -> - ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) - .withWorkQueueKeyFunc( - (V1Node node) -> - new Request(node.getMetadata().getName())) // optional, default to - .withOnAddFilter( - (V1Node createdNode) -> - createdNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onAdd filter - .withOnUpdateFilter( - (V1Node oldNode, V1Node newNode) -> - newNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onUpdate filter - .withOnDeleteFilter( - (V1Node deletedNode, Boolean stateUnknown) -> - deletedNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onDelete filter - .build()) - .withReconciler(nodeReconciler) // required, set the actual reconciler - .withName("node-printing-controller") // optional, set name for controller - .withWorkerCount(4) // optional, set worker thread count - .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the - // cache has synced up - .build(); - - // Use builder library to manage one or multiple controllers. - ControllerManager controllerManager = - ControllerBuilder.controllerManagerBuilder(informerFactory) - .addController(controller) - .build(); - - LeaderElectingController leaderElectingController = - new LeaderElectingController( - new LeaderElector( - new LeaderElectionConfig( - new EndpointsLock("kube-system", "leader-election", "foo"), - Duration.ofMillis(10000), - Duration.ofMillis(8000), - Duration.ofMillis(5000))), - controllerManager); - - leaderElectingController.run(); - } - - static class NodePrintingReconciler implements Reconciler { - - private Lister nodeLister; - private EventRecorder eventRecorder; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, EventRecorder recorder) { - this.nodeLister = new Lister<>(nodeInformer.getIndexer()); - this.eventRecorder = recorder; - } - - @Override - public Result reconcile(Request request) { - V1Node node = this.nodeLister.get(request.getName()); - System.out.println("triggered reconciling " + node.getMetadata().getName()); - this.eventRecorder.event( - node, - EventType.Normal, - "Print Node", - "Successfully printed %s", - node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java deleted file mode 100644 index bbb6575676..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/CopyExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Copy; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import io.kubernetes.client.util.exception.CopyNotSupportedException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Paths; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" - * - *

From inside $REPO_DIR/examples - */ -public class CopyExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, CopyNotSupportedException { - String podName = "kube-addon-manager-minikube"; - String namespace = "kube-system"; - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Copy copy = new Copy(); - InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); - Streams.copy(dataStream, System.out); - - copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); - - System.out.println("Done!"); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java deleted file mode 100644 index b8cb04616d..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; -import java.io.IOException; - -public class DynamicClientExample { - - public static void main(String[] args) throws IOException, ApiException { - - ApiClient apiClient = ClientBuilder.standard().build(); - - // retrieving the latest state of the default namespace - DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); - DynamicKubernetesObject defaultNamespace = - dynamicApi.get("default").throwsApiException().getObject(); - - // attaching a "foo=bar" label to the default namespace - defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); - DynamicKubernetesObject updatedDefaultNamespace = - dynamicApi.update(defaultNamespace).throwsApiException().getObject(); - - System.out.println(updatedDefaultNamespace); - - apiClient.getHttpClient().connectionPool().evictAll(); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java deleted file mode 100644 index 95d7fa51bc..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/Example.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.Example" - * - *

From inside $REPO_DIR/examples - */ -public class Example { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java deleted file mode 100644 index acea8e815a..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExecExample.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Exec; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExecExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, ParseException { - final Options options = new Options(); - options.addOption(new Option("p", "pod", true, "The name of the pod")); - options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); - - CommandLineParser parser = new DefaultParser(); - CommandLine cmd = parser.parse(options, args); - - String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); - String namespace = cmd.getOptionValue("n", "default"); - args = cmd.getArgs(); - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Exec exec = new Exec(); - boolean tty = System.console() != null; - // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] - // {"sh", "-c", "echo foo"}, true, tty); - final Process proc = - exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); - - Thread in = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(System.in, proc.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - in.start(); - - Thread out = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(proc.getInputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - out.start(); - - proc.waitFor(); - - // wait for any last output; no need to wait for input thread - out.join(); - - proc.destroy(); - - System.exit(proc.exitValue()); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java deleted file mode 100644 index e2b9c22177..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ExpandedExample.java +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentList; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1ServiceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExpandedExample { - - private static CoreV1Api COREV1_API; - private static final String DEFAULT_NAME_SPACE = "default"; - private static final Integer TIME_OUT_VALUE = 180; - private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); - - /** - * Main method - * - * @param args - */ - public static void main(String[] args) { - try { - ApiClient client = Config.defaultClient(); - // To change the context of k8s cluster, you can use - // io.kubernetes.client.util.KubeConfig - Configuration.setDefaultApiClient(client); - COREV1_API = new CoreV1Api(client); - - // ScaleUp/ScaleDown the Deployment pod - // Please change the name of Deployment? - System.out.println("----- Scale Deployment Start -----"); - scaleDeployment("account-service", 5); - - // List all of the namaspaces and pods - List nameSpaces = getAllNameSpaces(); - nameSpaces.stream() - .forEach( - namespace -> { - try { - System.out.println("----- " + namespace + " -----"); - getNamespacedPod(namespace).stream().forEach(System.out::println); - } catch (ApiException ex) { - LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); - } - }); - - // Print all of the Services - System.out.println("----- Print list all Services Start -----"); - List services = getServices(); - services.stream().forEach(System.out::println); - System.out.println("----- Print list all Services End -----"); - - // Print log of specific pod. In this example show the first pod logs. - System.out.println("----- Print Log of Specific Pod Start -----"); - String firstPodName = getPods().get(0); - printLog(DEFAULT_NAME_SPACE, firstPodName); - System.out.println("----- Print Log of Specific Pod End -----"); - } catch (ApiException | IOException ex) { - LOGGER.warn("Exception had occured ", ex); - } - } - - /** - * Get all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getAllNameSpaces() throws ApiException { - V1NamespaceList listNamespace = - COREV1_API.listNamespace( - "true", null, null, null, null, 0, null, null, Integer.MAX_VALUE, Boolean.FALSE); - List list = - listNamespace.getItems().stream() - .map(v1Namespace -> v1Namespace.getMetadata().getName()) - .collect(Collectors.toList()); - return list; - } - - /** - * List all pod names in all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getPods() throws ApiException { - V1PodList v1podList = - COREV1_API.listPodForAllNamespaces( - null, null, null, null, null, null, null, null, null, null); - List podList = - v1podList.getItems().stream() - .map(v1Pod -> v1Pod.getMetadata().getName()) - .collect(Collectors.toList()); - return podList; - } - - /** - * List all pod in the default namespace - * - * @return - * @throws ApiException - */ - public static List getNamespacedPod() throws ApiException { - return getNamespacedPod(DEFAULT_NAME_SPACE, null); - } - - /** - * List pod in specific namespace - * - * @param namespace - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace) throws ApiException { - return getNamespacedPod(namespace, null); - } - - /** - * List pod in specific namespace with label - * - * @param namespace - * @param label - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace, String label) throws ApiException { - V1PodList listNamespacedPod = - COREV1_API.listNamespacedPod( - namespace, - null, - null, - null, - null, - label, - Integer.MAX_VALUE, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - List listPods = - listNamespacedPod.getItems().stream() - .map(v1pod -> v1pod.getMetadata().getName()) - .collect(Collectors.toList()); - return listPods; - } - - /** - * List all Services in default namespace - * - * @return - * @throws ApiException - */ - public static List getServices() throws ApiException { - V1ServiceList listNamespacedService = - COREV1_API.listNamespacedService( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - Integer.MAX_VALUE, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - return listNamespacedService.getItems().stream() - .map(v1service -> v1service.getMetadata().getName()) - .collect(Collectors.toList()); - } - - /** - * Scale up/down the number of pod in Deployment - * - * @param deploymentName - * @param numberOfReplicas - * @throws ApiException - */ - public static void scaleDeployment(String deploymentName, int numberOfReplicas) - throws ApiException { - AppsV1Api appsV1Api = new AppsV1Api(); - appsV1Api.setApiClient(COREV1_API.getApiClient()); - V1DeploymentList listNamespacedDeployment = - appsV1Api.listNamespacedDeployment( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - null, - Boolean.FALSE); - - List appsV1DeploymentItems = listNamespacedDeployment.getItems(); - Optional findedDeployment = - appsV1DeploymentItems.stream() - .filter( - (V1Deployment deployment) -> - deployment.getMetadata().getName().equals(deploymentName)) - .findFirst(); - findedDeployment.ifPresent( - (V1Deployment deploy) -> { - try { - V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); - V1Deployment newDeploy = deploy.spec(newSpec); - appsV1Api.replaceNamespacedDeployment( - deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); - } catch (ApiException ex) { - LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); - } - }); - } - - /** - * Print out the Log for specific Pods - * - * @param namespace - * @param podName - * @throws ApiException - */ - public static void printLog(String namespace, String podName) throws ApiException { - // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog - String readNamespacedPodLog = - COREV1_API.readNamespacedPodLog( - podName, - namespace, - null, - Boolean.FALSE, - null, - Integer.MAX_VALUE, - null, - Boolean.FALSE, - Integer.MAX_VALUE, - 40, - Boolean.FALSE); - System.out.println(readNamespacedPodLog); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java deleted file mode 100644 index 8e48cc51b3..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/FluentExample.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.Arrays; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" - * - *

From inside $REPO_DIR/examples - */ -public class FluentExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .endContainer() - .endSpec() - .build(); - - api.createNamespacedPod("default", pod, null, null, null, null); - - V1Pod pod2 = - new V1Pod() - .metadata(new V1ObjectMeta().name("anotherpod")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); - - api.createNamespacedPod("default", pod2, null, null, null, null); - - V1PodList list = - api.listNamespacedPod( - "default", null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java deleted file mode 100644 index ddfb1243b8..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/GenericClientExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.util.Arrays; - -public class GenericClientExample { - - public static void main(String[] args) throws Exception { - - // The following codes demonstrates using generic client to manipulate pods - V1Pod pod = - new V1Pod() - .metadata(new V1ObjectMeta().name("foo").namespace("default")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("c").image("test")))); - - ApiClient apiClient = ClientBuilder.standard().build(); - GenericKubernetesApi podClient = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - - V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); - System.out.println("Created!"); - - V1Pod patchedPod = - podClient - .patch( - "default", - "foo", - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) - .throwsApiException() - .getObject(); - System.out.println("Patched!"); - - V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); - if (deletedPod != null) { - System.out.println( - "Received after-deletion status of the requested object, will be deleting in background!"); - } - System.out.println("Deleted!"); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java deleted file mode 100644 index 7ab705b440..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import java.io.IOException; - -/** - * A simple example of how to use the Java API inside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class InClusterClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // loading the in-cluster config, including: - // 1. service-account CA - // 2. service-account bearer-token - // 3. service-account namespace - // 4. master endpoints(ip, port) from pre-set environment variables - ApiClient client = ClientBuilder.cluster().build(); - - // if you prefer not to refresh service account token, please use: - // ApiClient client = ClientBuilder.oldCluster().build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java deleted file mode 100644 index bae1ef3595..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/InformerExample.java +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.informer.ResourceEventHandler; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.CallGeneratorParams; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" - * - *

From inside $REPO_DIR/examples - */ -public class InformerExample { - public static void main(String[] args) throws Exception { - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - SharedInformerFactory factory = new SharedInformerFactory(apiClient); - - // Node informer - SharedIndexInformer nodeInformer = - factory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - // **NOTE**: - // The following "CallGeneratorParams" lambda merely generates a stateless - // HTTPs requests, the effective apiClient is the one specified when constructing - // the informer-factory. - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - - nodeInformer.addEventHandler( - new ResourceEventHandler() { - @Override - public void onAdd(V1Node node) { - System.out.printf("%s node added!\n", node.getMetadata().getName()); - } - - @Override - public void onUpdate(V1Node oldNode, V1Node newNode) { - System.out.printf( - "%s => %s node updated!\n", - oldNode.getMetadata().getName(), newNode.getMetadata().getName()); - } - - @Override - public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { - System.out.printf("%s node deleted!\n", node.getMetadata().getName()); - } - }); - - factory.startAllRegisteredInformers(); - - V1Node nodeToCreate = new V1Node(); - V1ObjectMeta metadata = new V1ObjectMeta(); - metadata.setName("noxu"); - nodeToCreate.setMetadata(metadata); - V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); - Thread.sleep(3000); - - Lister nodeLister = new Lister(nodeInformer.getIndexer()); - V1Node node = nodeLister.get("noxu"); - System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); - factory.stopAllRegisteredInformers(); - Thread.sleep(3000); - System.out.println("informer stopped.."); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java deleted file mode 100644 index c4b15401b0..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.KubeConfig; -import java.io.FileReader; -import java.io.IOException; - -/** - * A simple example of how to use the Java API from an application outside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class KubeConfigFileClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // file path to your KubeConfig - - String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; - - // loading the out-of-cluster config, a kubeconfig from file-system - ApiClient client = - ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java deleted file mode 100644 index 2619c9f271..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/KubectlExample.java +++ /dev/null @@ -1,311 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; -import static io.kubernetes.client.extended.kubectl.Kubectl.copy; -import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.delete; -import static io.kubernetes.client.extended.kubectl.Kubectl.drain; -import static io.kubernetes.client.extended.kubectl.Kubectl.exec; -import static io.kubernetes.client.extended.kubectl.Kubectl.label; -import static io.kubernetes.client.extended.kubectl.Kubectl.log; -import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; -import static io.kubernetes.client.extended.kubectl.Kubectl.scale; -import static io.kubernetes.client.extended.kubectl.Kubectl.taint; -import static io.kubernetes.client.extended.kubectl.Kubectl.top; -import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.version; -import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; - -import io.kubernetes.client.common.KubernetesObject; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.extended.kubectl.KubectlExec; -import io.kubernetes.client.extended.kubectl.KubectlPortForward; -import io.kubernetes.client.extended.kubectl.exception.KubectlException; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1ReplicationController; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.lang3.tuple.Pair; - -/** - * A Java equivalent for the kubectl command line tool. Not nearly as complete. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" - * - *

From inside $REPO_DIR/examples - */ -public class KubectlExample { - static Class getClassForKind(String kind) { - switch (kind) { - case "pod": - case "pods": - return V1Pod.class; - case "deployment": - case "deployments": - return V1Deployment.class; - case "service": - case "services": - return V1Service.class; - case "node": - case "nodes": - return V1Node.class; - case "replicationcontroller": - case "replicationcontrollers": - return V1ReplicationController.class; - } - return null; - } - - private static final String PADDING = " "; - - private static String pad(String value) { - while (value.length() < PADDING.length()) { - value += " "; - } - return value; - } - - public static void main(String[] args) - throws java.io.IOException, KubectlException, ParseException { - ApiClient client = Config.defaultClient(); - - Options options = new Options(); - options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); - options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); - options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); - DefaultParser parser = new DefaultParser(); - CommandLine cli = parser.parse(options, args); - - args = cli.getArgs(); - String verb = args[0]; - String ns = cli.getOptionValue("n", "default"); - String kind = null; - String name = null; - - switch (verb) { - case "delete": - kind = args[1]; - name = args[2]; - delete(getClassForKind(kind)).namespace(ns).name(name).execute(); - case "drain": - name = args[1]; - drain().apiClient(client).name(name).execute(); - System.out.println("Node drained"); - System.exit(0); - case "cordon": - name = args[1]; - cordon().apiClient(client).name(name).execute(); - System.out.println("Node cordoned"); - System.exit(0); - case "uncordon": - name = args[1]; - uncordon().apiClient(client).name(name).execute(); - System.out.println("Node uncordoned"); - System.exit(0); - case "top": - String what = args[1]; - switch (what) { - case "nodes": - case "node": - List> nodes = - top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); - System.out.println(pad("Node") + "\tCPU\t\tMemory"); - for (Pair node : nodes) { - System.out.println( - pad(node.getLeft().getMetadata().getName()) - + "\t" - + node.getRight().getUsage().get("cpu").getNumber() - + "\t" - + node.getRight().getUsage().get("memory").getNumber()); - } - System.exit(0); - case "pods": - case "pod": - List> pods = - top(V1Pod.class, PodMetrics.class) - .apiClient(client) - .namespace(ns) - .metric("cpu") - .execute(); - System.out.println(pad("Pod") + "\tCPU\t\tMemory"); - for (Pair pod : pods) { - System.out.println( - pad(pod.getLeft().getMetadata().getName()) - + "\t" - + podMetricSum(pod.getRight(), "cpu") - + "\t" - + podMetricSum(pod.getRight(), "memory")); - } - System.exit(0); - } - System.err.println("Unknown top argument: " + what); - System.exit(-1); - case "cp": - String from = args[1]; - String to = args[2]; - if (from.indexOf(":") != -1) { - String[] parts = from.split(":"); - name = parts[0]; - from = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .fromPod(from) - .to(to) - .execute(); - } else if (to.indexOf(":") != -1) { - String[] parts = to.split(":"); - name = parts[0]; - to = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .from(from) - .toPod(to) - .execute(); - } else { - System.err.println("Missing pod name for copy."); - System.exit(-1); - } - System.out.println("Copied " + from + " -> " + to); - System.exit(0); - case "taint": - name = args[1]; - String taintSpec = args[2]; - boolean remove = taintSpec.endsWith("-"); - int ix = taintSpec.indexOf("="); - int ix2 = taintSpec.indexOf(":"); - - if (remove) { - taintSpec = taintSpec.substring(0, taintSpec.length() - 2); - String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); - String effect = ix == -1 ? null : taintSpec.substring(ix + 1); - - if (effect == null) { - taint().apiClient(client).name(name).removeTaint(key).execute(); - } else { - taint().apiClient(client).name(name).removeTaint(key, effect).execute(); - } - System.exit(0); - } - if (ix2 == -1) { - System.err.println("key:effect or key=value:effect is required."); - System.exit(-1); - } - String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); - String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); - String effect = taintSpec.substring(ix2 + 1); - - if (value == null) { - taint().apiClient(client).name(name).addTaint(key, effect).execute(); - } else { - taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); - } - System.exit(0); - case "portforward": - name = args[1]; - KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); - for (int i = 2; i < args.length; i++) { - String port = args[i]; - String[] ports = port.split(":"); - System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); - forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); - } - forward.execute(); - System.exit(0); - case "log": - name = args[1]; - Streams.copy( - log() - .apiClient(client) - .name(name) - .namespace(ns) - .container(cli.getOptionValue("c", "")) - .execute(), - System.out); - System.exit(0); - case "scale": - kind = args[1]; - name = args[2]; - if (!cli.hasOption("r")) { - System.err.println("--replicas is required"); - System.exit(-3); - } - int replicas = Integer.parseInt(cli.getOptionValue("r")); - scale(getClassForKind(kind)) - .apiClient(client) - .namespace(ns) - .name(name) - .replicas(replicas) - .execute(); - System.out.println("Deployment scaled."); - System.exit(0); - case "version": - System.out.println(version().apiClient(client)); - System.exit(0); - case "label": - kind = args[1]; - name = args[2]; - String labelKey = args[3]; - String labelValue = args[4]; - Class clazz = getClassForKind(kind); - if (clazz == null) { - System.err.println("Unknown kind: " + kind); - System.exit(-2); - } - label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); - System.exit(0); - case "exec": - name = args[1]; - String[] command = Arrays.copyOfRange(args, 2, args.length); - KubectlExec e = - exec() - .apiClient(client) - .namespace(ns) - .name(name) - .command(command) - .container(cli.getOptionValue("c", "")); - System.exit(e.execute()); - case "api-resources": - apiResources().apiClient(client).execute().stream() - .forEach( - r -> - System.out.printf( - "%s\t\t%s\t\t%s\t\t%s\n", - r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); - System.exit(0); - default: - System.out.println("Unknown verb: " + verb); - System.exit(-1); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java deleted file mode 100644 index 0e48689602..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.time.Duration; -import java.util.UUID; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" - * - *

From inside $REPO_DIR/examples - */ -public class LeaderElectionExample { - public static void main(String[] args) throws Exception { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // New - String appNamespace = "default"; - String appName = "leader-election-foobar"; - String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique - EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); - - LeaderElectionConfig leaderElectionConfig = - new LeaderElectionConfig( - lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); - try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { - leaderElector.run( - () -> { - System.out.println("Do something when getting leadership."); - }, - () -> { - System.out.println("Do something when losing leadership."); - }); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java deleted file mode 100644 index dbfa157eea..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/LogsExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PodLogs; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.io.InputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" - * - *

From inside $REPO_DIR/examples - */ -public class LogsExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - CoreV1Api coreApi = new CoreV1Api(client); - - PodLogs logs = new PodLogs(); - V1Pod pod = - coreApi - .listNamespacedPod( - "default", "false", null, null, null, null, null, null, null, null, null) - .getItems() - .get(0); - - InputStream is = logs.streamNamespacedPodLog(pod); - Streams.copy(is, System.out); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java deleted file mode 100644 index 0d8c10e30b..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/MetricsExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Metrics; -import io.kubernetes.client.custom.ContainerMetrics; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.NodeMetricsList; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" - * - *

From inside $REPO_DIR/examples - */ -public class MetricsExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Metrics metrics = new Metrics(client); - NodeMetricsList list = metrics.getNodeMetrics(); - for (NodeMetrics item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - for (String key : item.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + item.getUsage().get(key)); - } - System.out.println(); - } - - for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - if (item.getContainers() == null) { - continue; - } - for (ContainerMetrics container : item.getContainers()) { - System.out.println(container.getName()); - System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - for (String key : container.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + container.getUsage().get(key)); - } - System.out.println(); - } - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java deleted file mode 100644 index b0a4ac4fa4..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PagerExample.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.pager.Pager; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" - * - *

From inside $REPO_DIR/examples - */ -public class PagerExample { - public static void main(String[] args) throws IOException { - - ApiClient client = Config.defaultClient(); - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - CoreV1Api api = new CoreV1Api(); - int i = 0; - Pager pager = - new Pager( - (Pager.PagerParams param) -> { - try { - return api.listNamespaceCall( - null, - null, - param.getContinueToken(), - null, - null, - param.getLimit(), - null, - null, - 1, - null, - null); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, - client, - 10, - V1NamespaceList.class); - for (V1Namespace namespace : pager) { - System.out.println(namespace.getMetadata().getName()); - } - System.out.println("------------------"); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java deleted file mode 100644 index 92866a46fe..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ParseExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" - * - *

From inside $REPO_DIR/examples - */ -public class ParseExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - if (args.length < 2) { - System.err.println("Usage: ParseExample "); - System.exit(1); - } - ApiClient client = Config.defaultClient(); - FileReader json = new FileReader(args[0]); - Object obj = - client - .getJSON() - .getGson() - .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); - - String output = client.getJSON().getGson().toJson(obj); - - // Test round tripping... - Object obj2 = - client - .getJSON() - .getGson() - .fromJson( - new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); - - String output2 = client.getJSON().getGson().toJson(obj2); - - // Validate round trip - if (!output.equals(output2)) { - System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); - System.exit(2); - } - - System.out.println(output); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java deleted file mode 100644 index 8f1d123978..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PatchExample.java +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.PatchUtils; -import java.io.IOException; - -/** - * A simple Example of how to use the Java API.
- * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
- * For generating Json Patches, refer http://jsonpatch.com. For - * generating Strategic Merge Patches, refer strategic-merge-patch.md. - * - *

    - *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a - * finalizer. - *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. - *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. - *
- * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" - * - *

From inside $REPO_DIR/examples - */ -public class PatchExample { - static String jsonPatchStr = - "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; - static String strategicMergePatchStr = - "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; - static String jsonDeploymentStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - static String applyYamlStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - - public static void main(String[] args) throws IOException { - try { - AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); - V1Deployment body = - Configuration.getDefaultApiClient() - .getJSON() - .deserialize(jsonDeploymentStr, V1Deployment.class); - - // create a deployment - V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null); - System.out.println("original deployment" + deploy1); - - // json-patch a deployment - V1Deployment deploy2 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(jsonPatchStr), - null, - null, - null, // field-manager is optional - null, - null, - null), - V1Patch.PATCH_FORMAT_JSON_PATCH, - api.getApiClient()); - System.out.println("json-patched deployment" + deploy2); - - // strategic-merge-patch a deployment - V1Deployment deploy3 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(strategicMergePatchStr), - null, - null, - null, // field-manager is optional - null, - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - api.getApiClient()); - System.out.println("strategic-merge-patched deployment" + deploy3); - - // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 - // or opt-in by turning on the feature gate for v1.14 or v1.15. - // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply - V1Deployment deploy4 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(applyYamlStr), - null, - null, - "example-field-manager", // field-manager is required for server-side apply - null, - true, - null), - V1Patch.PATCH_FORMAT_APPLY_YAML, - api.getApiClient()); - System.out.println("application/apply-patch+yaml deployment" + deploy4); - - } catch (ApiException e) { - System.out.println(e.getResponseBody()); - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java deleted file mode 100644 index cbe064db31..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PortForwardExample.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PortForward; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.List; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside - * $REPO_DIR/examples - * - *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times - * out pretty fast...) - */ -public class PortForwardExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - PortForward forward = new PortForward(); - List ports = new ArrayList<>(); - int localPort = 8080; - int targetPort = 8080; - ports.add(targetPort); - final PortForward.PortForwardResult result = - forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); - System.out.println("Forwarding!"); - ServerSocket ss = new ServerSocket(localPort); - - final Socket s = ss.accept(); - System.out.println("Connected!"); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - - System.exit(0); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java deleted file mode 100644 index 65f38b8ce4..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PromOpExample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.coreos.monitoring.models.V1Prometheus; -import com.coreos.monitoring.models.V1PrometheusList; -import com.coreos.monitoring.models.V1PrometheusSpec; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -public class PromOpExample { - public static void main(String[] args) throws IOException, ApiException { - GenericKubernetesApi prometheusApi = - new GenericKubernetesApi<>( - V1Prometheus.class, - V1PrometheusList.class, - "monitoring.coreos.com", - "v1", - "prometheuses", - ClientBuilder.defaultClient()); - prometheusApi - .create( - new V1Prometheus() - .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) - .kind("Prometheus") - .apiVersion("monitoring.coreos.com/v1") - .spec(new V1PrometheusSpec())) - .throwsApiException(); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java deleted file mode 100644 index d2afb10142..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/PrometheusExample.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.monitoring.Monitoring; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API with Prometheus metrics - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" - * - *

From inside $REPO_DIR/examples - */ -public class PrometheusExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // Install an HTTP Interceptor that adds metrics - Monitoring.installMetrics(client); - - // Install a simple HTTP server to serve prometheus metrics. If you already are serving - // metrics elsewhere, this is unnecessary. - Monitoring.startMetricsServer("localhost", 8080); - - CoreV1Api api = new CoreV1Api(); - - while (true) { - // A request that should return 200 - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - // A request that should return 404 - try { - V1Pod pod = api.readNamespacedPod("foo", "bar", null); - } catch (ApiException ex) { - if (ex.getCode() != 404) { - throw ex; - } - } - try { - Thread.sleep(10000); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java deleted file mode 100644 index e4e05a2aa1..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/ProtoExample.java +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.ProtoClient; -import io.kubernetes.client.ProtoClient.ObjectOrStatus; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.proto.Meta.ObjectMeta; -import io.kubernetes.client.proto.V1.Namespace; -import io.kubernetes.client.proto.V1.NamespaceSpec; -import io.kubernetes.client.proto.V1.Pod; -import io.kubernetes.client.proto.V1.PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" - * - *

From inside $REPO_DIR/examples - */ -public class ProtoExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - ProtoClient pc = new ProtoClient(client); - ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); - - if (list.object.getItemsCount() > 0) { - Pod p = list.object.getItems(0); - System.out.println(p); - } - - Namespace namespace = - Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); - - ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); - System.out.println(ns); - if (ns.object != null) { - namespace = - ns.object - .toBuilder() - .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) - .build(); - // This is how you would update an object, but you can't actually - // update namespaces, so this returns a 405 - ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); - System.out.println(ns.status); - } - - ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); - System.out.println(ns); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java deleted file mode 100644 index f6494a836e..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.openapi.models.V1EndpointsList; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.time.Duration; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; - -@SpringBootApplication -public class SpringControllerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringControllerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner commandLineRunner( - SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("running controller.."); - nodePrintingController.run(); - }; - } - - @Bean - public Controller nodePrintingController( - SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { - DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); - builder = - builder.watch( - (q) -> { - return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) - .withResyncPeriod(Duration.ofMinutes(1)) - .build(); - }); - builder.withWorkerCount(2); - builder.withReadyFunc(reconciler::informerReady); - return builder.withReconciler(reconciler).withName("nodePrintingController").build(); - } - - @Bean - public SharedIndexInformer endpointsInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>( - V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); - } - - @Bean - public SharedIndexInformer nodeInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); - } - - @Bean - public SharedIndexInformer podInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); - } - } - - @Component - public static class NodePrintingReconciler implements Reconciler { - - @Value("${namespace}") - private String namespace; - - private SharedInformer nodeInformer; - - private SharedInformer podInformer; - - private Lister nodeLister; - - private Lister podLister; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { - this.nodeInformer = nodeInformer; - this.podInformer = podInformer; - this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); - this.podLister = new Lister<>(podInformer.getIndexer(), namespace); - } - - // *OPTIONAL* - // If you want to hold the controller from running util some condition.. - public boolean informerReady() { - return podInformer.hasSynced() && nodeInformer.hasSynced(); - } - - @Override - public Result reconcile(Request request) { - V1Node node = nodeLister.get(request.getName()); - - System.out.println("get all pods in namespace " + namespace); - podLister.namespace(namespace).list().stream() - .map(pod -> pod.getMetadata().getName()) - .forEach(System.out::println); - - System.out.println("triggered reconciling " + node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java deleted file mode 100644 index bafe11e421..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.network.EndpointsLoadBalancer; -import io.kubernetes.client.extended.network.LoadBalancer; -import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@SpringBootApplication -public class SpringLoadBalancerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringLoadBalancerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner loadBalancerCommandLineRunner( - SharedInformerFactory sharedInformerFactory, MyService myService) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("routing default/kubernetes:"); - System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); - }; - } - - @Bean - public MyService myService(SharedIndexInformer lister) { - return new MyService(new Lister<>(lister.getIndexer())); - } - } - - public static class MyService { - - private LoadBalancer defaultKubernetesLoadBalancer; - - public MyService(Lister lister) { - InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); - RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); - defaultKubernetesLoadBalancer = - new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java deleted file mode 100644 index c32a74afd4..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WatchExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.google.gson.reflect.TypeToken; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Watch; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** A simple example of how to use Watch API to watch changes in Namespace list. */ -public class WatchExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - // infinite timeout - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - Watch watch = - Watch.createWatch( - client, - api.listNamespaceCall( - null, null, null, null, null, 5, null, null, null, Boolean.TRUE, null), - new TypeToken>() {}.getType()); - - try { - for (Watch.Response item : watch) { - System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); - } - } finally { - watch.close(); - } - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java deleted file mode 100644 index e1f54dcd07..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.WebSockets; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import okhttp3.WebSocket; - -/** - * This is a pretty low level, most people won't need to use WebSockets directly. - * - *

If you do need to run it, you can run: mvn exec:java \ - * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ - * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true - * - *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP - * GET calls. - */ -public class WebSocketsExample { - public static void main(String... args) throws ApiException, IOException { - final ApiClient client = Config.defaultClient(); - WebSockets.stream( - args[0], - "GET", - client, - new WebSockets.SocketListener() { - private volatile WebSocket socket; - - @Override - public void open(String protocol, WebSocket socket) { - this.socket = socket; - } - - @Override - public void close() {} - - @Override - public void bytesMessage(InputStream is) {} - - @Override - public void failure(Throwable t) { - t.printStackTrace(); - } - - @Override - public void textMessage(Reader in) { - try { - BufferedReader reader = new BufferedReader(in); - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - System.out.println(line); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - } -} diff --git a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java deleted file mode 100644 index 67b5536ab9..0000000000 --- a/examples/examples-release-16/src/main/java/io/kubernetes/client/examples/YamlExample.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.IntOrString; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.openapi.models.V1ServiceBuilder; -import io.kubernetes.client.openapi.models.V1Status; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Yaml; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" - * - *

From inside $REPO_DIR/examples - */ -public class YamlExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .withNewResources() - .withLimits(new HashMap<>()) - .endResources() - .endContainer() - .endSpec() - .build(); - System.out.println(Yaml.dump(pod)); - - V1Service svc = - new V1ServiceBuilder() - .withNewMetadata() - .withName("aservice") - .endMetadata() - .withNewSpec() - .withSessionAffinity("ClientIP") - .withType("NodePort") - .addNewPort() - .withProtocol("TCP") - .withName("client") - .withPort(8008) - .withNodePort(8080) - .withTargetPort(new IntOrString(8080)) - .endPort() - .endSpec() - .build(); - System.out.println(Yaml.dump(svc)); - - // Read yaml configuration file, and deploy it - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // See issue #474. Not needed at most cases, but it is needed if you are using war - // packging or running this on JUnit. - Yaml.addModelMap("v1", "Service", V1Service.class); - - // Example yaml file can be found in $REPO_DIR/test-svc.yaml - File file = new File("test-svc.yaml"); - V1Service yamlSvc = (V1Service) Yaml.load(file); - - // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of - // CoreV1API - CoreV1Api api = new CoreV1Api(); - V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null); - - System.out.println(createResult); - - V1Service deleteResult = - api.deleteNamespacedService( - yamlSvc.getMetadata().getName(), - "default", - null, - null, - null, - null, - null, - new V1DeleteOptions()); - System.out.println(deleteResult); - } -} diff --git a/examples/examples-release-16/src/main/resources/application.properties b/examples/examples-release-16/src/main/resources/application.properties deleted file mode 100644 index dc886e5f48..0000000000 --- a/examples/examples-release-16/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -namespace=airflow -management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java deleted file mode 100644 index df2f168e41..0000000000 --- a/examples/examples-release-16/src/test/java/io/kubernetes/client/examples/ExampleTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertEquals; - -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; -import org.junit.Rule; -import org.junit.Test; - -public class ExampleTest { - private static final int PORT = 8089; - @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); - - @Test - public void exactUrlOnly() throws IOException, ApiException { - ApiClient client = new ApiClient(); - client.setBasePath("http://localhost:" + PORT); - Configuration.setDefaultApiClient(client); - - V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); - - stubFor( - get(urlEqualTo("/api/v1/namespaces/name")) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBody(client.getJSON().serialize(ns1)))); - - CoreV1Api api = new CoreV1Api(); - V1Namespace ns2 = api.readNamespace("name", null); - assertEquals(ns1, ns2); - } -} diff --git a/examples/examples-release-16/test-svc.yaml b/examples/examples-release-16/test-svc.yaml deleted file mode 100644 index f225bea76f..0000000000 --- a/examples/examples-release-16/test-svc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: test-service -spec: - type: ClusterIP - selector: - app: test-service - ports: - - name: port-of-container - port: 8080 \ No newline at end of file diff --git a/examples/examples-release-16/test.yaml b/examples/examples-release-16/test.yaml deleted file mode 100644 index 0b46e57003..0000000000 --- a/examples/examples-release-16/test.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: test -spec: - replicas: 1 - template: - metadata: - labels: - app: test - spec: - containers: - - name: test - image: test/examples:1.0 - command: ["/bin/sh","-c"] - args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-17/Dockerfile b/examples/examples-release-17/Dockerfile deleted file mode 100644 index ac90eb1d67..0000000000 --- a/examples/examples-release-17/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8-jre - -COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar - -CMD ["java", "-jar", "/examples.jar"] - - diff --git a/examples/examples-release-17/README.md b/examples/examples-release-17/README.md deleted file mode 100644 index c6e02e41fd..0000000000 --- a/examples/examples-release-17/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Running examples - -```sh -export REPO_ROOT=/path/to/client-java/repo - -cd ${REPO_ROOT}/ -mvn install - -cd ${REPO_ROOT}/examples/examples-14 -mvn compile -mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" -``` - diff --git a/examples/examples-release-17/createPod.sh b/examples/examples-release-17/createPod.sh deleted file mode 100755 index 18a9841317..0000000000 --- a/examples/examples-release-17/createPod.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# creates a pod and runs -# Example.java(list pods for all namespaces) on starting of pod - -# Exit on any error. -set -e - -if ! which minikube > /dev/null; then - echo "This script requires minikube installed." - exit 100 -fi - -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -export REPO_ROOT=${dir}/.. - -cd ${REPO_ROOT} -mvn install - -cd ${REPO_ROOT}/examples -mvn package - -eval $(minikube docker-env) -docker build -t test/examples:1.0 . -kubectl apply -f test.yaml diff --git a/examples/examples-release-17/pom.xml b/examples/examples-release-17/pom.xml deleted file mode 100644 index 186080c741..0000000000 --- a/examples/examples-release-17/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - 4.0.0 - - - io.kubernetes - client-java-examples-parent - 25.0.0-legacy-SNAPSHOT - .. - - - client-java-examples-release-17 - client-java-examples-release-17 - - - - ch.qos.logback - logback-classic - runtime - - - io.prometheus - simpleclient - 0.16.0 - - - io.prometheus - simpleclient_httpserver - 0.16.0 - - - io.kubernetes - client-java-api - 17.0.0 - - - io.kubernetes - client-java - 17.0.0 - - - io.kubernetes - client-java-extended - 17.0.0 - - - io.kubernetes - client-java-spring-integration - 17.0.0 - - - io.kubernetes - client-java-proto - 17.0.0 - - - commons-cli - commons-cli - - - io.kubernetes - client-java-cert-manager-models - 10.0.1 - - - io.kubernetes - client-java-prometheus-operator-models - 10.0.1 - - - - junit - junit - test - - - com.github.tomakehurst - wiremock - test - - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-actuator - ${spring.boot.version} - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - 3.1.4 - - true - - - - - - \ No newline at end of file diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java deleted file mode 100644 index 7f753b8d8f..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/AttachExample.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Attach; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" - * - *

From inside $REPO_DIR/examples - */ -public class AttachExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Attach attach = new Attach(); - final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); - - new Thread( - new Runnable() { - public void run() { - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - OutputStream output = result.getStandardInputStream(); - try { - while (true) { - String line = in.readLine(); - output.write(line.getBytes()); - output.write('\n'); - output.flush(); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getStandardOutputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - result.close(); - System.exit(0); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java deleted file mode 100644 index b616a18ee9..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CertManagerExample.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; -import io.cert.manager.models.V1beta1Issuer; -import io.cert.manager.models.V1beta1IssuerList; -import io.cert.manager.models.V1beta1IssuerSpec; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -/** - * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a - * Kubernetes cluster where cert-manager is installed - */ -public class CertManagerExample { - public static void main(String[] args) throws IOException { - GenericKubernetesApi issuerApi = - new GenericKubernetesApi<>( - V1beta1Issuer.class, - V1beta1IssuerList.class, - "cert-manager.io", - "v1beta1", - "issuers", - ClientBuilder.defaultClient()); - issuerApi.create( - new V1beta1Issuer() - .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) - .kind("Issuer") - .apiVersion("cert-manager.io/v1beta1") - .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java deleted file mode 100644 index fed0e544d3..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ControllerExample.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.ControllerManager; -import io.kubernetes.client.extended.controller.LeaderElectingController; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.extended.event.EventType; -import io.kubernetes.client.extended.event.legacy.EventBroadcaster; -import io.kubernetes.client.extended.event.legacy.EventRecorder; -import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1EventSource; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.util.CallGeneratorParams; -import java.io.IOException; -import java.time.Duration; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -public class ControllerExample { - public static void main(String[] args) throws IOException { - - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - // instantiating an informer-factory, and there should be only one informer-factory - // globally. - SharedInformerFactory informerFactory = new SharedInformerFactory(); - // registering node-informer into the informer-factory. - SharedIndexInformer nodeInformer = - informerFactory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - informerFactory.startAllRegisteredInformers(); - - EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); - - // nodeReconciler prints node information on events - NodePrintingReconciler nodeReconciler = - new NodePrintingReconciler( - nodeInformer, - eventBroadcaster.newRecorder( - new V1EventSource().host("localhost").component("node-printer"))); - - // Use builder library to construct a default controller. - Controller controller = - ControllerBuilder.defaultBuilder(informerFactory) - .watch( - (workQueue) -> - ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) - .withWorkQueueKeyFunc( - (V1Node node) -> - new Request(node.getMetadata().getName())) // optional, default to - .withOnAddFilter( - (V1Node createdNode) -> - createdNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onAdd filter - .withOnUpdateFilter( - (V1Node oldNode, V1Node newNode) -> - newNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onUpdate filter - .withOnDeleteFilter( - (V1Node deletedNode, Boolean stateUnknown) -> - deletedNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onDelete filter - .build()) - .withReconciler(nodeReconciler) // required, set the actual reconciler - .withName("node-printing-controller") // optional, set name for controller - .withWorkerCount(4) // optional, set worker thread count - .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the - // cache has synced up - .build(); - - // Use builder library to manage one or multiple controllers. - ControllerManager controllerManager = - ControllerBuilder.controllerManagerBuilder(informerFactory) - .addController(controller) - .build(); - - LeaderElectingController leaderElectingController = - new LeaderElectingController( - new LeaderElector( - new LeaderElectionConfig( - new EndpointsLock("kube-system", "leader-election", "foo"), - Duration.ofMillis(10000), - Duration.ofMillis(8000), - Duration.ofMillis(5000))), - controllerManager); - - leaderElectingController.run(); - } - - static class NodePrintingReconciler implements Reconciler { - - private Lister nodeLister; - private EventRecorder eventRecorder; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, EventRecorder recorder) { - this.nodeLister = new Lister<>(nodeInformer.getIndexer()); - this.eventRecorder = recorder; - } - - @Override - public Result reconcile(Request request) { - V1Node node = this.nodeLister.get(request.getName()); - System.out.println("triggered reconciling " + node.getMetadata().getName()); - this.eventRecorder.event( - node, - EventType.Normal, - "Print Node", - "Successfully printed %s", - node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java deleted file mode 100644 index bbb6575676..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/CopyExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Copy; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import io.kubernetes.client.util.exception.CopyNotSupportedException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Paths; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" - * - *

From inside $REPO_DIR/examples - */ -public class CopyExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, CopyNotSupportedException { - String podName = "kube-addon-manager-minikube"; - String namespace = "kube-system"; - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Copy copy = new Copy(); - InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); - Streams.copy(dataStream, System.out); - - copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); - - System.out.println("Done!"); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java deleted file mode 100644 index b8cb04616d..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; -import java.io.IOException; - -public class DynamicClientExample { - - public static void main(String[] args) throws IOException, ApiException { - - ApiClient apiClient = ClientBuilder.standard().build(); - - // retrieving the latest state of the default namespace - DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); - DynamicKubernetesObject defaultNamespace = - dynamicApi.get("default").throwsApiException().getObject(); - - // attaching a "foo=bar" label to the default namespace - defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); - DynamicKubernetesObject updatedDefaultNamespace = - dynamicApi.update(defaultNamespace).throwsApiException().getObject(); - - System.out.println(updatedDefaultNamespace); - - apiClient.getHttpClient().connectionPool().evictAll(); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java deleted file mode 100644 index 95d7fa51bc..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/Example.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.Example" - * - *

From inside $REPO_DIR/examples - */ -public class Example { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java deleted file mode 100644 index acea8e815a..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExecExample.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Exec; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExecExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, ParseException { - final Options options = new Options(); - options.addOption(new Option("p", "pod", true, "The name of the pod")); - options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); - - CommandLineParser parser = new DefaultParser(); - CommandLine cmd = parser.parse(options, args); - - String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); - String namespace = cmd.getOptionValue("n", "default"); - args = cmd.getArgs(); - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Exec exec = new Exec(); - boolean tty = System.console() != null; - // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] - // {"sh", "-c", "echo foo"}, true, tty); - final Process proc = - exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); - - Thread in = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(System.in, proc.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - in.start(); - - Thread out = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(proc.getInputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - out.start(); - - proc.waitFor(); - - // wait for any last output; no need to wait for input thread - out.join(); - - proc.destroy(); - - System.exit(proc.exitValue()); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java deleted file mode 100644 index 261323c512..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ExpandedExample.java +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentList; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1ServiceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExpandedExample { - - private static CoreV1Api COREV1_API; - private static final String DEFAULT_NAME_SPACE = "default"; - private static final Integer TIME_OUT_VALUE = 180; - private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); - - /** - * Main method - * - * @param args - */ - public static void main(String[] args) { - try { - ApiClient client = Config.defaultClient(); - // To change the context of k8s cluster, you can use - // io.kubernetes.client.util.KubeConfig - Configuration.setDefaultApiClient(client); - COREV1_API = new CoreV1Api(client); - - // ScaleUp/ScaleDown the Deployment pod - // Please change the name of Deployment? - System.out.println("----- Scale Deployment Start -----"); - scaleDeployment("account-service", 5); - - // List all of the namespaces and pods - List nameSpaces = getAllNameSpaces(); - nameSpaces.stream() - .forEach( - namespace -> { - try { - System.out.println("----- " + namespace + " -----"); - getNamespacedPod(namespace).stream().forEach(System.out::println); - } catch (ApiException ex) { - LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); - } - }); - - // Print all of the Services - System.out.println("----- Print list all Services Start -----"); - List services = getServices(); - services.stream().forEach(System.out::println); - System.out.println("----- Print list all Services End -----"); - - // Print log of specific pod. In this example show the first pod logs. - System.out.println("----- Print Log of Specific Pod Start -----"); - String firstPodName = getPods().get(0); - printLog(DEFAULT_NAME_SPACE, firstPodName); - System.out.println("----- Print Log of Specific Pod End -----"); - } catch (ApiException | IOException ex) { - LOGGER.warn("Exception had occured ", ex); - } - } - - /** - * Get all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getAllNameSpaces() throws ApiException { - V1NamespaceList listNamespace = - COREV1_API.listNamespace( - "true", null, null, null, null, 0, null, null, Integer.MAX_VALUE, Boolean.FALSE); - List list = - listNamespace.getItems().stream() - .map(v1Namespace -> v1Namespace.getMetadata().getName()) - .collect(Collectors.toList()); - return list; - } - - /** - * List all pod names in all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getPods() throws ApiException { - V1PodList v1podList = - COREV1_API.listPodForAllNamespaces( - null, null, null, null, null, null, null, null, null, null); - List podList = - v1podList.getItems().stream() - .map(v1Pod -> v1Pod.getMetadata().getName()) - .collect(Collectors.toList()); - return podList; - } - - /** - * List all pod in the default namespace - * - * @return - * @throws ApiException - */ - public static List getNamespacedPod() throws ApiException { - return getNamespacedPod(DEFAULT_NAME_SPACE, null); - } - - /** - * List pod in specific namespace - * - * @param namespace - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace) throws ApiException { - return getNamespacedPod(namespace, null); - } - - /** - * List pod in specific namespace with label - * - * @param namespace - * @param label - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace, String label) throws ApiException { - V1PodList listNamespacedPod = - COREV1_API.listNamespacedPod( - namespace, - null, - null, - null, - null, - label, - Integer.MAX_VALUE, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - List listPods = - listNamespacedPod.getItems().stream() - .map(v1pod -> v1pod.getMetadata().getName()) - .collect(Collectors.toList()); - return listPods; - } - - /** - * List all Services in default namespace - * - * @return - * @throws ApiException - */ - public static List getServices() throws ApiException { - V1ServiceList listNamespacedService = - COREV1_API.listNamespacedService( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - Integer.MAX_VALUE, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - return listNamespacedService.getItems().stream() - .map(v1service -> v1service.getMetadata().getName()) - .collect(Collectors.toList()); - } - - /** - * Scale up/down the number of pod in Deployment - * - * @param deploymentName - * @param numberOfReplicas - * @throws ApiException - */ - public static void scaleDeployment(String deploymentName, int numberOfReplicas) - throws ApiException { - AppsV1Api appsV1Api = new AppsV1Api(); - appsV1Api.setApiClient(COREV1_API.getApiClient()); - V1DeploymentList listNamespacedDeployment = - appsV1Api.listNamespacedDeployment( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - null, - Boolean.FALSE); - - List appsV1DeploymentItems = listNamespacedDeployment.getItems(); - Optional findedDeployment = - appsV1DeploymentItems.stream() - .filter( - (V1Deployment deployment) -> - deployment.getMetadata().getName().equals(deploymentName)) - .findFirst(); - findedDeployment.ifPresent( - (V1Deployment deploy) -> { - try { - V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); - V1Deployment newDeploy = deploy.spec(newSpec); - appsV1Api.replaceNamespacedDeployment( - deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); - } catch (ApiException ex) { - LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); - } - }); - } - - /** - * Print out the Log for specific Pods - * - * @param namespace - * @param podName - * @throws ApiException - */ - public static void printLog(String namespace, String podName) throws ApiException { - // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog - String readNamespacedPodLog = - COREV1_API.readNamespacedPodLog( - podName, - namespace, - null, - Boolean.FALSE, - null, - Integer.MAX_VALUE, - null, - Boolean.FALSE, - Integer.MAX_VALUE, - 40, - Boolean.FALSE); - System.out.println(readNamespacedPodLog); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java deleted file mode 100644 index 8e48cc51b3..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/FluentExample.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.Arrays; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" - * - *

From inside $REPO_DIR/examples - */ -public class FluentExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .endContainer() - .endSpec() - .build(); - - api.createNamespacedPod("default", pod, null, null, null, null); - - V1Pod pod2 = - new V1Pod() - .metadata(new V1ObjectMeta().name("anotherpod")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); - - api.createNamespacedPod("default", pod2, null, null, null, null); - - V1PodList list = - api.listNamespacedPod( - "default", null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java deleted file mode 100644 index ddfb1243b8..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/GenericClientExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.util.Arrays; - -public class GenericClientExample { - - public static void main(String[] args) throws Exception { - - // The following codes demonstrates using generic client to manipulate pods - V1Pod pod = - new V1Pod() - .metadata(new V1ObjectMeta().name("foo").namespace("default")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("c").image("test")))); - - ApiClient apiClient = ClientBuilder.standard().build(); - GenericKubernetesApi podClient = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - - V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); - System.out.println("Created!"); - - V1Pod patchedPod = - podClient - .patch( - "default", - "foo", - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) - .throwsApiException() - .getObject(); - System.out.println("Patched!"); - - V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); - if (deletedPod != null) { - System.out.println( - "Received after-deletion status of the requested object, will be deleting in background!"); - } - System.out.println("Deleted!"); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java deleted file mode 100644 index 7ab705b440..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import java.io.IOException; - -/** - * A simple example of how to use the Java API inside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class InClusterClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // loading the in-cluster config, including: - // 1. service-account CA - // 2. service-account bearer-token - // 3. service-account namespace - // 4. master endpoints(ip, port) from pre-set environment variables - ApiClient client = ClientBuilder.cluster().build(); - - // if you prefer not to refresh service account token, please use: - // ApiClient client = ClientBuilder.oldCluster().build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java deleted file mode 100644 index bae1ef3595..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/InformerExample.java +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.informer.ResourceEventHandler; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.CallGeneratorParams; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" - * - *

From inside $REPO_DIR/examples - */ -public class InformerExample { - public static void main(String[] args) throws Exception { - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - SharedInformerFactory factory = new SharedInformerFactory(apiClient); - - // Node informer - SharedIndexInformer nodeInformer = - factory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - // **NOTE**: - // The following "CallGeneratorParams" lambda merely generates a stateless - // HTTPs requests, the effective apiClient is the one specified when constructing - // the informer-factory. - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - - nodeInformer.addEventHandler( - new ResourceEventHandler() { - @Override - public void onAdd(V1Node node) { - System.out.printf("%s node added!\n", node.getMetadata().getName()); - } - - @Override - public void onUpdate(V1Node oldNode, V1Node newNode) { - System.out.printf( - "%s => %s node updated!\n", - oldNode.getMetadata().getName(), newNode.getMetadata().getName()); - } - - @Override - public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { - System.out.printf("%s node deleted!\n", node.getMetadata().getName()); - } - }); - - factory.startAllRegisteredInformers(); - - V1Node nodeToCreate = new V1Node(); - V1ObjectMeta metadata = new V1ObjectMeta(); - metadata.setName("noxu"); - nodeToCreate.setMetadata(metadata); - V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); - Thread.sleep(3000); - - Lister nodeLister = new Lister(nodeInformer.getIndexer()); - V1Node node = nodeLister.get("noxu"); - System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); - factory.stopAllRegisteredInformers(); - Thread.sleep(3000); - System.out.println("informer stopped.."); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java deleted file mode 100644 index c4b15401b0..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.KubeConfig; -import java.io.FileReader; -import java.io.IOException; - -/** - * A simple example of how to use the Java API from an application outside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class KubeConfigFileClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // file path to your KubeConfig - - String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; - - // loading the out-of-cluster config, a kubeconfig from file-system - ApiClient client = - ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java deleted file mode 100644 index 2619c9f271..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/KubectlExample.java +++ /dev/null @@ -1,311 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; -import static io.kubernetes.client.extended.kubectl.Kubectl.copy; -import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.delete; -import static io.kubernetes.client.extended.kubectl.Kubectl.drain; -import static io.kubernetes.client.extended.kubectl.Kubectl.exec; -import static io.kubernetes.client.extended.kubectl.Kubectl.label; -import static io.kubernetes.client.extended.kubectl.Kubectl.log; -import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; -import static io.kubernetes.client.extended.kubectl.Kubectl.scale; -import static io.kubernetes.client.extended.kubectl.Kubectl.taint; -import static io.kubernetes.client.extended.kubectl.Kubectl.top; -import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.version; -import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; - -import io.kubernetes.client.common.KubernetesObject; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.extended.kubectl.KubectlExec; -import io.kubernetes.client.extended.kubectl.KubectlPortForward; -import io.kubernetes.client.extended.kubectl.exception.KubectlException; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1ReplicationController; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.lang3.tuple.Pair; - -/** - * A Java equivalent for the kubectl command line tool. Not nearly as complete. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" - * - *

From inside $REPO_DIR/examples - */ -public class KubectlExample { - static Class getClassForKind(String kind) { - switch (kind) { - case "pod": - case "pods": - return V1Pod.class; - case "deployment": - case "deployments": - return V1Deployment.class; - case "service": - case "services": - return V1Service.class; - case "node": - case "nodes": - return V1Node.class; - case "replicationcontroller": - case "replicationcontrollers": - return V1ReplicationController.class; - } - return null; - } - - private static final String PADDING = " "; - - private static String pad(String value) { - while (value.length() < PADDING.length()) { - value += " "; - } - return value; - } - - public static void main(String[] args) - throws java.io.IOException, KubectlException, ParseException { - ApiClient client = Config.defaultClient(); - - Options options = new Options(); - options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); - options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); - options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); - DefaultParser parser = new DefaultParser(); - CommandLine cli = parser.parse(options, args); - - args = cli.getArgs(); - String verb = args[0]; - String ns = cli.getOptionValue("n", "default"); - String kind = null; - String name = null; - - switch (verb) { - case "delete": - kind = args[1]; - name = args[2]; - delete(getClassForKind(kind)).namespace(ns).name(name).execute(); - case "drain": - name = args[1]; - drain().apiClient(client).name(name).execute(); - System.out.println("Node drained"); - System.exit(0); - case "cordon": - name = args[1]; - cordon().apiClient(client).name(name).execute(); - System.out.println("Node cordoned"); - System.exit(0); - case "uncordon": - name = args[1]; - uncordon().apiClient(client).name(name).execute(); - System.out.println("Node uncordoned"); - System.exit(0); - case "top": - String what = args[1]; - switch (what) { - case "nodes": - case "node": - List> nodes = - top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); - System.out.println(pad("Node") + "\tCPU\t\tMemory"); - for (Pair node : nodes) { - System.out.println( - pad(node.getLeft().getMetadata().getName()) - + "\t" - + node.getRight().getUsage().get("cpu").getNumber() - + "\t" - + node.getRight().getUsage().get("memory").getNumber()); - } - System.exit(0); - case "pods": - case "pod": - List> pods = - top(V1Pod.class, PodMetrics.class) - .apiClient(client) - .namespace(ns) - .metric("cpu") - .execute(); - System.out.println(pad("Pod") + "\tCPU\t\tMemory"); - for (Pair pod : pods) { - System.out.println( - pad(pod.getLeft().getMetadata().getName()) - + "\t" - + podMetricSum(pod.getRight(), "cpu") - + "\t" - + podMetricSum(pod.getRight(), "memory")); - } - System.exit(0); - } - System.err.println("Unknown top argument: " + what); - System.exit(-1); - case "cp": - String from = args[1]; - String to = args[2]; - if (from.indexOf(":") != -1) { - String[] parts = from.split(":"); - name = parts[0]; - from = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .fromPod(from) - .to(to) - .execute(); - } else if (to.indexOf(":") != -1) { - String[] parts = to.split(":"); - name = parts[0]; - to = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .from(from) - .toPod(to) - .execute(); - } else { - System.err.println("Missing pod name for copy."); - System.exit(-1); - } - System.out.println("Copied " + from + " -> " + to); - System.exit(0); - case "taint": - name = args[1]; - String taintSpec = args[2]; - boolean remove = taintSpec.endsWith("-"); - int ix = taintSpec.indexOf("="); - int ix2 = taintSpec.indexOf(":"); - - if (remove) { - taintSpec = taintSpec.substring(0, taintSpec.length() - 2); - String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); - String effect = ix == -1 ? null : taintSpec.substring(ix + 1); - - if (effect == null) { - taint().apiClient(client).name(name).removeTaint(key).execute(); - } else { - taint().apiClient(client).name(name).removeTaint(key, effect).execute(); - } - System.exit(0); - } - if (ix2 == -1) { - System.err.println("key:effect or key=value:effect is required."); - System.exit(-1); - } - String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); - String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); - String effect = taintSpec.substring(ix2 + 1); - - if (value == null) { - taint().apiClient(client).name(name).addTaint(key, effect).execute(); - } else { - taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); - } - System.exit(0); - case "portforward": - name = args[1]; - KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); - for (int i = 2; i < args.length; i++) { - String port = args[i]; - String[] ports = port.split(":"); - System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); - forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); - } - forward.execute(); - System.exit(0); - case "log": - name = args[1]; - Streams.copy( - log() - .apiClient(client) - .name(name) - .namespace(ns) - .container(cli.getOptionValue("c", "")) - .execute(), - System.out); - System.exit(0); - case "scale": - kind = args[1]; - name = args[2]; - if (!cli.hasOption("r")) { - System.err.println("--replicas is required"); - System.exit(-3); - } - int replicas = Integer.parseInt(cli.getOptionValue("r")); - scale(getClassForKind(kind)) - .apiClient(client) - .namespace(ns) - .name(name) - .replicas(replicas) - .execute(); - System.out.println("Deployment scaled."); - System.exit(0); - case "version": - System.out.println(version().apiClient(client)); - System.exit(0); - case "label": - kind = args[1]; - name = args[2]; - String labelKey = args[3]; - String labelValue = args[4]; - Class clazz = getClassForKind(kind); - if (clazz == null) { - System.err.println("Unknown kind: " + kind); - System.exit(-2); - } - label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); - System.exit(0); - case "exec": - name = args[1]; - String[] command = Arrays.copyOfRange(args, 2, args.length); - KubectlExec e = - exec() - .apiClient(client) - .namespace(ns) - .name(name) - .command(command) - .container(cli.getOptionValue("c", "")); - System.exit(e.execute()); - case "api-resources": - apiResources().apiClient(client).execute().stream() - .forEach( - r -> - System.out.printf( - "%s\t\t%s\t\t%s\t\t%s\n", - r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); - System.exit(0); - default: - System.out.println("Unknown verb: " + verb); - System.exit(-1); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java deleted file mode 100644 index 0e48689602..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.time.Duration; -import java.util.UUID; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" - * - *

From inside $REPO_DIR/examples - */ -public class LeaderElectionExample { - public static void main(String[] args) throws Exception { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // New - String appNamespace = "default"; - String appName = "leader-election-foobar"; - String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique - EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); - - LeaderElectionConfig leaderElectionConfig = - new LeaderElectionConfig( - lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); - try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { - leaderElector.run( - () -> { - System.out.println("Do something when getting leadership."); - }, - () -> { - System.out.println("Do something when losing leadership."); - }); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java deleted file mode 100644 index dbfa157eea..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/LogsExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PodLogs; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.io.InputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" - * - *

From inside $REPO_DIR/examples - */ -public class LogsExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - CoreV1Api coreApi = new CoreV1Api(client); - - PodLogs logs = new PodLogs(); - V1Pod pod = - coreApi - .listNamespacedPod( - "default", "false", null, null, null, null, null, null, null, null, null) - .getItems() - .get(0); - - InputStream is = logs.streamNamespacedPodLog(pod); - Streams.copy(is, System.out); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java deleted file mode 100644 index 0d8c10e30b..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/MetricsExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Metrics; -import io.kubernetes.client.custom.ContainerMetrics; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.NodeMetricsList; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" - * - *

From inside $REPO_DIR/examples - */ -public class MetricsExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Metrics metrics = new Metrics(client); - NodeMetricsList list = metrics.getNodeMetrics(); - for (NodeMetrics item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - for (String key : item.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + item.getUsage().get(key)); - } - System.out.println(); - } - - for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - if (item.getContainers() == null) { - continue; - } - for (ContainerMetrics container : item.getContainers()) { - System.out.println(container.getName()); - System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - for (String key : container.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + container.getUsage().get(key)); - } - System.out.println(); - } - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java deleted file mode 100644 index b0a4ac4fa4..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PagerExample.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.pager.Pager; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" - * - *

From inside $REPO_DIR/examples - */ -public class PagerExample { - public static void main(String[] args) throws IOException { - - ApiClient client = Config.defaultClient(); - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - CoreV1Api api = new CoreV1Api(); - int i = 0; - Pager pager = - new Pager( - (Pager.PagerParams param) -> { - try { - return api.listNamespaceCall( - null, - null, - param.getContinueToken(), - null, - null, - param.getLimit(), - null, - null, - 1, - null, - null); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, - client, - 10, - V1NamespaceList.class); - for (V1Namespace namespace : pager) { - System.out.println(namespace.getMetadata().getName()); - } - System.out.println("------------------"); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java deleted file mode 100644 index 92866a46fe..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ParseExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" - * - *

From inside $REPO_DIR/examples - */ -public class ParseExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - if (args.length < 2) { - System.err.println("Usage: ParseExample "); - System.exit(1); - } - ApiClient client = Config.defaultClient(); - FileReader json = new FileReader(args[0]); - Object obj = - client - .getJSON() - .getGson() - .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); - - String output = client.getJSON().getGson().toJson(obj); - - // Test round tripping... - Object obj2 = - client - .getJSON() - .getGson() - .fromJson( - new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); - - String output2 = client.getJSON().getGson().toJson(obj2); - - // Validate round trip - if (!output.equals(output2)) { - System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); - System.exit(2); - } - - System.out.println(output); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java deleted file mode 100644 index 3f2457a47a..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PatchExample.java +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.PatchUtils; -import java.io.IOException; - -/** - * A simple Example of how to use the Java API.
- * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
- * For generating Json Patches, refer http://jsonpatch.com. For - * generating Strategic Merge Patches, refer strategic-merge-patch.md. - * - *

    - *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a - * finalizer. - *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. - *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. - *
- * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" - * - *

From inside $REPO_DIR/examples - */ -public class PatchExample { - static String jsonPatchStr = - "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; - static String strategicMergePatchStr = - "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; - static String jsonDeploymentStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - static String applyYamlStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - - public static void main(String[] args) throws IOException { - try { - AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); - V1Deployment body = - Configuration.getDefaultApiClient() - .getJSON() - .deserialize(jsonDeploymentStr, V1Deployment.class); - - // create a deployment - V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null); - System.out.println("original deployment" + deploy1); - - // json-patch a deployment - V1Deployment deploy2 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(jsonPatchStr), - null, - null, - null, - null, // field-manager is optional - null, - null), - V1Patch.PATCH_FORMAT_JSON_PATCH, - api.getApiClient()); - System.out.println("json-patched deployment" + deploy2); - - // strategic-merge-patch a deployment - V1Deployment deploy3 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(strategicMergePatchStr), - null, - null, - null, - null, // field-manager is optional - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - api.getApiClient()); - System.out.println("strategic-merge-patched deployment" + deploy3); - - // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 - // or opt-in by turning on the feature gate for v1.14 or v1.15. - // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply - V1Deployment deploy4 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(applyYamlStr), - null, - null, - "example-field-manager", // field-manager is required for server-side apply - null, - true, - null), - V1Patch.PATCH_FORMAT_APPLY_YAML, - api.getApiClient()); - System.out.println("application/apply-patch+yaml deployment" + deploy4); - - } catch (ApiException e) { - System.out.println(e.getResponseBody()); - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java deleted file mode 100644 index cbe064db31..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PortForwardExample.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PortForward; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.List; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside - * $REPO_DIR/examples - * - *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times - * out pretty fast...) - */ -public class PortForwardExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - PortForward forward = new PortForward(); - List ports = new ArrayList<>(); - int localPort = 8080; - int targetPort = 8080; - ports.add(targetPort); - final PortForward.PortForwardResult result = - forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); - System.out.println("Forwarding!"); - ServerSocket ss = new ServerSocket(localPort); - - final Socket s = ss.accept(); - System.out.println("Connected!"); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - - System.exit(0); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java deleted file mode 100644 index 65f38b8ce4..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PromOpExample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.coreos.monitoring.models.V1Prometheus; -import com.coreos.monitoring.models.V1PrometheusList; -import com.coreos.monitoring.models.V1PrometheusSpec; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -public class PromOpExample { - public static void main(String[] args) throws IOException, ApiException { - GenericKubernetesApi prometheusApi = - new GenericKubernetesApi<>( - V1Prometheus.class, - V1PrometheusList.class, - "monitoring.coreos.com", - "v1", - "prometheuses", - ClientBuilder.defaultClient()); - prometheusApi - .create( - new V1Prometheus() - .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) - .kind("Prometheus") - .apiVersion("monitoring.coreos.com/v1") - .spec(new V1PrometheusSpec())) - .throwsApiException(); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java deleted file mode 100644 index d2afb10142..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/PrometheusExample.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.monitoring.Monitoring; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API with Prometheus metrics - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" - * - *

From inside $REPO_DIR/examples - */ -public class PrometheusExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // Install an HTTP Interceptor that adds metrics - Monitoring.installMetrics(client); - - // Install a simple HTTP server to serve prometheus metrics. If you already are serving - // metrics elsewhere, this is unnecessary. - Monitoring.startMetricsServer("localhost", 8080); - - CoreV1Api api = new CoreV1Api(); - - while (true) { - // A request that should return 200 - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - // A request that should return 404 - try { - V1Pod pod = api.readNamespacedPod("foo", "bar", null); - } catch (ApiException ex) { - if (ex.getCode() != 404) { - throw ex; - } - } - try { - Thread.sleep(10000); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java deleted file mode 100644 index e4e05a2aa1..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/ProtoExample.java +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.ProtoClient; -import io.kubernetes.client.ProtoClient.ObjectOrStatus; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.proto.Meta.ObjectMeta; -import io.kubernetes.client.proto.V1.Namespace; -import io.kubernetes.client.proto.V1.NamespaceSpec; -import io.kubernetes.client.proto.V1.Pod; -import io.kubernetes.client.proto.V1.PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" - * - *

From inside $REPO_DIR/examples - */ -public class ProtoExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - ProtoClient pc = new ProtoClient(client); - ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); - - if (list.object.getItemsCount() > 0) { - Pod p = list.object.getItems(0); - System.out.println(p); - } - - Namespace namespace = - Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); - - ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); - System.out.println(ns); - if (ns.object != null) { - namespace = - ns.object - .toBuilder() - .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) - .build(); - // This is how you would update an object, but you can't actually - // update namespaces, so this returns a 405 - ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); - System.out.println(ns.status); - } - - ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); - System.out.println(ns); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java deleted file mode 100644 index f6494a836e..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.openapi.models.V1EndpointsList; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.time.Duration; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; - -@SpringBootApplication -public class SpringControllerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringControllerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner commandLineRunner( - SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("running controller.."); - nodePrintingController.run(); - }; - } - - @Bean - public Controller nodePrintingController( - SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { - DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); - builder = - builder.watch( - (q) -> { - return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) - .withResyncPeriod(Duration.ofMinutes(1)) - .build(); - }); - builder.withWorkerCount(2); - builder.withReadyFunc(reconciler::informerReady); - return builder.withReconciler(reconciler).withName("nodePrintingController").build(); - } - - @Bean - public SharedIndexInformer endpointsInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>( - V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); - } - - @Bean - public SharedIndexInformer nodeInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); - } - - @Bean - public SharedIndexInformer podInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); - } - } - - @Component - public static class NodePrintingReconciler implements Reconciler { - - @Value("${namespace}") - private String namespace; - - private SharedInformer nodeInformer; - - private SharedInformer podInformer; - - private Lister nodeLister; - - private Lister podLister; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { - this.nodeInformer = nodeInformer; - this.podInformer = podInformer; - this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); - this.podLister = new Lister<>(podInformer.getIndexer(), namespace); - } - - // *OPTIONAL* - // If you want to hold the controller from running util some condition.. - public boolean informerReady() { - return podInformer.hasSynced() && nodeInformer.hasSynced(); - } - - @Override - public Result reconcile(Request request) { - V1Node node = nodeLister.get(request.getName()); - - System.out.println("get all pods in namespace " + namespace); - podLister.namespace(namespace).list().stream() - .map(pod -> pod.getMetadata().getName()) - .forEach(System.out::println); - - System.out.println("triggered reconciling " + node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java deleted file mode 100644 index bafe11e421..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.network.EndpointsLoadBalancer; -import io.kubernetes.client.extended.network.LoadBalancer; -import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@SpringBootApplication -public class SpringLoadBalancerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringLoadBalancerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner loadBalancerCommandLineRunner( - SharedInformerFactory sharedInformerFactory, MyService myService) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("routing default/kubernetes:"); - System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); - }; - } - - @Bean - public MyService myService(SharedIndexInformer lister) { - return new MyService(new Lister<>(lister.getIndexer())); - } - } - - public static class MyService { - - private LoadBalancer defaultKubernetesLoadBalancer; - - public MyService(Lister lister) { - InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); - RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); - defaultKubernetesLoadBalancer = - new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java deleted file mode 100644 index c32a74afd4..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WatchExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.google.gson.reflect.TypeToken; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Watch; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** A simple example of how to use Watch API to watch changes in Namespace list. */ -public class WatchExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - // infinite timeout - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - Watch watch = - Watch.createWatch( - client, - api.listNamespaceCall( - null, null, null, null, null, 5, null, null, null, Boolean.TRUE, null), - new TypeToken>() {}.getType()); - - try { - for (Watch.Response item : watch) { - System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); - } - } finally { - watch.close(); - } - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java deleted file mode 100644 index e1f54dcd07..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.WebSockets; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import okhttp3.WebSocket; - -/** - * This is a pretty low level, most people won't need to use WebSockets directly. - * - *

If you do need to run it, you can run: mvn exec:java \ - * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ - * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true - * - *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP - * GET calls. - */ -public class WebSocketsExample { - public static void main(String... args) throws ApiException, IOException { - final ApiClient client = Config.defaultClient(); - WebSockets.stream( - args[0], - "GET", - client, - new WebSockets.SocketListener() { - private volatile WebSocket socket; - - @Override - public void open(String protocol, WebSocket socket) { - this.socket = socket; - } - - @Override - public void close() {} - - @Override - public void bytesMessage(InputStream is) {} - - @Override - public void failure(Throwable t) { - t.printStackTrace(); - } - - @Override - public void textMessage(Reader in) { - try { - BufferedReader reader = new BufferedReader(in); - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - System.out.println(line); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - } -} diff --git a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java deleted file mode 100644 index 67b5536ab9..0000000000 --- a/examples/examples-release-17/src/main/java/io/kubernetes/client/examples/YamlExample.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.IntOrString; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.openapi.models.V1ServiceBuilder; -import io.kubernetes.client.openapi.models.V1Status; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Yaml; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" - * - *

From inside $REPO_DIR/examples - */ -public class YamlExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .withNewResources() - .withLimits(new HashMap<>()) - .endResources() - .endContainer() - .endSpec() - .build(); - System.out.println(Yaml.dump(pod)); - - V1Service svc = - new V1ServiceBuilder() - .withNewMetadata() - .withName("aservice") - .endMetadata() - .withNewSpec() - .withSessionAffinity("ClientIP") - .withType("NodePort") - .addNewPort() - .withProtocol("TCP") - .withName("client") - .withPort(8008) - .withNodePort(8080) - .withTargetPort(new IntOrString(8080)) - .endPort() - .endSpec() - .build(); - System.out.println(Yaml.dump(svc)); - - // Read yaml configuration file, and deploy it - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // See issue #474. Not needed at most cases, but it is needed if you are using war - // packging or running this on JUnit. - Yaml.addModelMap("v1", "Service", V1Service.class); - - // Example yaml file can be found in $REPO_DIR/test-svc.yaml - File file = new File("test-svc.yaml"); - V1Service yamlSvc = (V1Service) Yaml.load(file); - - // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of - // CoreV1API - CoreV1Api api = new CoreV1Api(); - V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null); - - System.out.println(createResult); - - V1Service deleteResult = - api.deleteNamespacedService( - yamlSvc.getMetadata().getName(), - "default", - null, - null, - null, - null, - null, - new V1DeleteOptions()); - System.out.println(deleteResult); - } -} diff --git a/examples/examples-release-17/src/main/resources/application.properties b/examples/examples-release-17/src/main/resources/application.properties deleted file mode 100644 index dc886e5f48..0000000000 --- a/examples/examples-release-17/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -namespace=airflow -management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java deleted file mode 100644 index df2f168e41..0000000000 --- a/examples/examples-release-17/src/test/java/io/kubernetes/client/examples/ExampleTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertEquals; - -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; -import org.junit.Rule; -import org.junit.Test; - -public class ExampleTest { - private static final int PORT = 8089; - @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); - - @Test - public void exactUrlOnly() throws IOException, ApiException { - ApiClient client = new ApiClient(); - client.setBasePath("http://localhost:" + PORT); - Configuration.setDefaultApiClient(client); - - V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); - - stubFor( - get(urlEqualTo("/api/v1/namespaces/name")) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBody(client.getJSON().serialize(ns1)))); - - CoreV1Api api = new CoreV1Api(); - V1Namespace ns2 = api.readNamespace("name", null); - assertEquals(ns1, ns2); - } -} diff --git a/examples/examples-release-17/test-svc.yaml b/examples/examples-release-17/test-svc.yaml deleted file mode 100644 index f225bea76f..0000000000 --- a/examples/examples-release-17/test-svc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: test-service -spec: - type: ClusterIP - selector: - app: test-service - ports: - - name: port-of-container - port: 8080 \ No newline at end of file diff --git a/examples/examples-release-17/test.yaml b/examples/examples-release-17/test.yaml deleted file mode 100644 index 0b46e57003..0000000000 --- a/examples/examples-release-17/test.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: test -spec: - replicas: 1 - template: - metadata: - labels: - app: test - spec: - containers: - - name: test - image: test/examples:1.0 - command: ["/bin/sh","-c"] - args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-18/Dockerfile b/examples/examples-release-18/Dockerfile deleted file mode 100644 index ac90eb1d67..0000000000 --- a/examples/examples-release-18/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8-jre - -COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar - -CMD ["java", "-jar", "/examples.jar"] - - diff --git a/examples/examples-release-18/README.md b/examples/examples-release-18/README.md deleted file mode 100644 index 80c34ea272..0000000000 --- a/examples/examples-release-18/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Running examples - -```sh -export REPO_ROOT=/path/to/client-java/repo - -cd ${REPO_ROOT}/ -mvn install - -cd ${REPO_ROOT}/examples/examples-15 -mvn compile -mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" -``` - diff --git a/examples/examples-release-18/createPod.sh b/examples/examples-release-18/createPod.sh deleted file mode 100755 index 18a9841317..0000000000 --- a/examples/examples-release-18/createPod.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# creates a pod and runs -# Example.java(list pods for all namespaces) on starting of pod - -# Exit on any error. -set -e - -if ! which minikube > /dev/null; then - echo "This script requires minikube installed." - exit 100 -fi - -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -export REPO_ROOT=${dir}/.. - -cd ${REPO_ROOT} -mvn install - -cd ${REPO_ROOT}/examples -mvn package - -eval $(minikube docker-env) -docker build -t test/examples:1.0 . -kubectl apply -f test.yaml diff --git a/examples/examples-release-18/pom.xml b/examples/examples-release-18/pom.xml deleted file mode 100644 index a05742a6eb..0000000000 --- a/examples/examples-release-18/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - 4.0.0 - - - io.kubernetes - client-java-examples-parent - 25.0.0-legacy-SNAPSHOT - .. - - - client-java-examples-release-18 - client-java-examples-release-18 - - - - ch.qos.logback - logback-classic - runtime - - - io.prometheus - simpleclient - 0.16.0 - - - io.prometheus - simpleclient_httpserver - 0.16.0 - - - io.kubernetes - client-java-api - 18.0.1 - - - io.kubernetes - client-java - 18.0.1 - - - io.kubernetes - client-java-extended - 18.0.1 - - - io.kubernetes - client-java-spring-integration - 18.0.1 - - - io.kubernetes - client-java-proto - 18.0.1 - - - commons-cli - commons-cli - - - io.kubernetes - client-java-cert-manager-models - 10.0.1 - - - io.kubernetes - client-java-prometheus-operator-models - 10.0.1 - - - - junit - junit - test - - - com.github.tomakehurst - wiremock - test - - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-actuator - ${spring.boot.version} - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - true - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - 3.1.4 - - true - - - - - - \ No newline at end of file diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java deleted file mode 100644 index 7f753b8d8f..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/AttachExample.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Attach; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" - * - *

From inside $REPO_DIR/examples - */ -public class AttachExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Attach attach = new Attach(); - final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); - - new Thread( - new Runnable() { - public void run() { - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - OutputStream output = result.getStandardInputStream(); - try { - while (true) { - String line = in.readLine(); - output.write(line.getBytes()); - output.write('\n'); - output.flush(); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getStandardOutputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - result.close(); - System.exit(0); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java deleted file mode 100644 index b616a18ee9..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CertManagerExample.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; -import io.cert.manager.models.V1beta1Issuer; -import io.cert.manager.models.V1beta1IssuerList; -import io.cert.manager.models.V1beta1IssuerSpec; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -/** - * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a - * Kubernetes cluster where cert-manager is installed - */ -public class CertManagerExample { - public static void main(String[] args) throws IOException { - GenericKubernetesApi issuerApi = - new GenericKubernetesApi<>( - V1beta1Issuer.class, - V1beta1IssuerList.class, - "cert-manager.io", - "v1beta1", - "issuers", - ClientBuilder.defaultClient()); - issuerApi.create( - new V1beta1Issuer() - .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) - .kind("Issuer") - .apiVersion("cert-manager.io/v1beta1") - .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java deleted file mode 100644 index 4fe2969a3d..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ControllerExample.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.ControllerManager; -import io.kubernetes.client.extended.controller.LeaderElectingController; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.extended.event.EventType; -import io.kubernetes.client.extended.event.legacy.EventBroadcaster; -import io.kubernetes.client.extended.event.legacy.EventRecorder; -import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1EventSource; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.util.CallGeneratorParams; -import java.io.IOException; -import java.time.Duration; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -public class ControllerExample { - public static void main(String[] args) throws IOException { - - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - // instantiating an informer-factory, and there should be only one informer-factory - // globally. - SharedInformerFactory informerFactory = new SharedInformerFactory(); - // registering node-informer into the informer-factory. - SharedIndexInformer nodeInformer = - informerFactory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - informerFactory.startAllRegisteredInformers(); - - EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); - - // nodeReconciler prints node information on events - NodePrintingReconciler nodeReconciler = - new NodePrintingReconciler( - nodeInformer, - eventBroadcaster.newRecorder( - new V1EventSource().host("localhost").component("node-printer"))); - - // Use builder library to construct a default controller. - Controller controller = - ControllerBuilder.defaultBuilder(informerFactory) - .watch( - (workQueue) -> - ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) - .withWorkQueueKeyFunc( - (V1Node node) -> - new Request(node.getMetadata().getName())) // optional, default to - .withOnAddFilter( - (V1Node createdNode) -> - createdNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onAdd filter - .withOnUpdateFilter( - (V1Node oldNode, V1Node newNode) -> - newNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onUpdate filter - .withOnDeleteFilter( - (V1Node deletedNode, Boolean stateUnknown) -> - deletedNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onDelete filter - .build()) - .withReconciler(nodeReconciler) // required, set the actual reconciler - .withName("node-printing-controller") // optional, set name for controller - .withWorkerCount(4) // optional, set worker thread count - .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the - // cache has synced up - .build(); - - // Use builder library to manage one or multiple controllers. - ControllerManager controllerManager = - ControllerBuilder.controllerManagerBuilder(informerFactory) - .addController(controller) - .build(); - - LeaderElectingController leaderElectingController = - new LeaderElectingController( - new LeaderElector( - new LeaderElectionConfig( - new EndpointsLock("kube-system", "leader-election", "foo"), - Duration.ofMillis(10000), - Duration.ofMillis(8000), - Duration.ofMillis(5000))), - controllerManager); - - leaderElectingController.run(); - } - - static class NodePrintingReconciler implements Reconciler { - - private Lister nodeLister; - private EventRecorder eventRecorder; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, EventRecorder recorder) { - this.nodeLister = new Lister<>(nodeInformer.getIndexer()); - this.eventRecorder = recorder; - } - - @Override - public Result reconcile(Request request) { - V1Node node = this.nodeLister.get(request.getName()); - System.out.println("triggered reconciling " + node.getMetadata().getName()); - this.eventRecorder.event( - node, - EventType.Normal, - "Print Node", - "Successfully printed %s", - node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java deleted file mode 100644 index bbb6575676..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/CopyExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Copy; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import io.kubernetes.client.util.exception.CopyNotSupportedException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Paths; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" - * - *

From inside $REPO_DIR/examples - */ -public class CopyExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, CopyNotSupportedException { - String podName = "kube-addon-manager-minikube"; - String namespace = "kube-system"; - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Copy copy = new Copy(); - InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); - Streams.copy(dataStream, System.out); - - copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); - - System.out.println("Done!"); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java deleted file mode 100644 index 42a2524f7b..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentBuilder; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1LabelSelector; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.openapi.models.V1PodTemplateSpec; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.PatchUtils; -import io.kubernetes.client.util.wait.Wait; -import java.io.IOException; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.Collections; - -public class DeployRolloutRestartExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - AppsV1Api appsV1Api = new AppsV1Api(client); - - String deploymentName = "example-nginx"; - String imageName = "nginx:1.21.6"; - String namespace = "default"; - - // Create an example deployment - V1DeploymentBuilder deploymentBuilder = - new V1DeploymentBuilder() - .withApiVersion("apps/v1") - .withKind("Deployment") - .withMetadata(new V1ObjectMeta().name(deploymentName).namespace(namespace)) - .withSpec( - new V1DeploymentSpec() - .replicas(1) - .selector(new V1LabelSelector().putMatchLabelsItem("name", deploymentName)) - .template( - new V1PodTemplateSpec() - .metadata(new V1ObjectMeta().putLabelsItem("name", deploymentName)) - .spec( - new V1PodSpec() - .containers( - Collections.singletonList( - new V1Container() - .name(deploymentName) - .image(imageName)))))); - appsV1Api.createNamespacedDeployment( - namespace, deploymentBuilder.build(), null, null, null, null); - - // Wait until example deployment is ready - Wait.poll( - Duration.ofSeconds(3), - Duration.ofSeconds(60), - () -> { - try { - System.out.println("Waiting until example deployment is ready..."); - return appsV1Api - .readNamespacedDeployment(deploymentName, namespace, null) - .getStatus() - .getReadyReplicas() - > 0; - } catch (ApiException e) { - e.printStackTrace(); - return false; - } - }); - System.out.println("Created example deployment!"); - - // Trigger a rollout restart of the example deployment - V1Deployment runningDeployment = - appsV1Api.readNamespacedDeployment(deploymentName, namespace, null); - - // Explicitly set "restartedAt" annotation with current date/time to trigger rollout when patch - // is applied - runningDeployment - .getSpec() - .getTemplate() - .getMetadata() - .putAnnotationsItem("kubectl.kubernetes.io/restartedAt", LocalDateTime.now().toString()); - try { - String deploymentJson = client.getJSON().serialize(runningDeployment); - - PatchUtils.patch( - V1Deployment.class, - () -> - appsV1Api.patchNamespacedDeploymentCall( - deploymentName, - namespace, - new V1Patch(deploymentJson), - null, - null, - "kubectl-rollout", - null, - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - client); - - // Wait until deployment has stabilized after rollout restart - Wait.poll( - Duration.ofSeconds(3), - Duration.ofSeconds(60), - () -> { - try { - System.out.println("Waiting until example deployment restarted successfully..."); - return appsV1Api - .readNamespacedDeployment(deploymentName, namespace, null) - .getStatus() - .getReadyReplicas() - > 0; - } catch (ApiException e) { - e.printStackTrace(); - return false; - } - }); - System.out.println("Example deployment restarted successfully!"); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java deleted file mode 100644 index b8cb04616d..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; -import java.io.IOException; - -public class DynamicClientExample { - - public static void main(String[] args) throws IOException, ApiException { - - ApiClient apiClient = ClientBuilder.standard().build(); - - // retrieving the latest state of the default namespace - DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); - DynamicKubernetesObject defaultNamespace = - dynamicApi.get("default").throwsApiException().getObject(); - - // attaching a "foo=bar" label to the default namespace - defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); - DynamicKubernetesObject updatedDefaultNamespace = - dynamicApi.update(defaultNamespace).throwsApiException().getObject(); - - System.out.println(updatedDefaultNamespace); - - apiClient.getHttpClient().connectionPool().evictAll(); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java deleted file mode 100644 index 2c2d1d737e..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.Example" - * - *

From inside $REPO_DIR/examples - */ -public class Example { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java deleted file mode 100644 index acea8e815a..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExecExample.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Exec; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExecExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, ParseException { - final Options options = new Options(); - options.addOption(new Option("p", "pod", true, "The name of the pod")); - options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); - - CommandLineParser parser = new DefaultParser(); - CommandLine cmd = parser.parse(options, args); - - String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); - String namespace = cmd.getOptionValue("n", "default"); - args = cmd.getArgs(); - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Exec exec = new Exec(); - boolean tty = System.console() != null; - // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] - // {"sh", "-c", "echo foo"}, true, tty); - final Process proc = - exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); - - Thread in = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(System.in, proc.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - in.start(); - - Thread out = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(proc.getInputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - out.start(); - - proc.waitFor(); - - // wait for any last output; no need to wait for input thread - out.join(); - - proc.destroy(); - - System.exit(proc.exitValue()); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java deleted file mode 100644 index ab6ff1c448..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ExpandedExample.java +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentList; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1ServiceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExpandedExample { - - private static CoreV1Api COREV1_API; - private static final String DEFAULT_NAME_SPACE = "default"; - private static final Integer TIME_OUT_VALUE = 180; - private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); - - /** - * Main method - * - * @param args - */ - public static void main(String[] args) { - try { - ApiClient client = Config.defaultClient(); - // To change the context of k8s cluster, you can use - // io.kubernetes.client.util.KubeConfig - Configuration.setDefaultApiClient(client); - COREV1_API = new CoreV1Api(client); - - // ScaleUp/ScaleDown the Deployment pod - // Please change the name of Deployment? - System.out.println("----- Scale Deployment Start -----"); - scaleDeployment("account-service", 5); - - // List all of the namaspaces and pods - List nameSpaces = getAllNameSpaces(); - nameSpaces.stream() - .forEach( - namespace -> { - try { - System.out.println("----- " + namespace + " -----"); - getNamespacedPod(namespace).stream().forEach(System.out::println); - } catch (ApiException ex) { - LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); - } - }); - - // Print all of the Services - System.out.println("----- Print list all Services Start -----"); - List services = getServices(); - services.stream().forEach(System.out::println); - System.out.println("----- Print list all Services End -----"); - - // Print log of specific pod. In this example show the first pod logs. - System.out.println("----- Print Log of Specific Pod Start -----"); - String firstPodName = getPods().get(0); - printLog(DEFAULT_NAME_SPACE, firstPodName); - System.out.println("----- Print Log of Specific Pod End -----"); - } catch (ApiException | IOException ex) { - LOGGER.warn("Exception had occured ", ex); - } - } - - /** - * Get all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getAllNameSpaces() throws ApiException { - V1NamespaceList listNamespace = - COREV1_API.listNamespace( - null, null, null, null, null, null, null, null, null, null); - List list = - listNamespace.getItems().stream() - .map(v1Namespace -> v1Namespace.getMetadata().getName()) - .collect(Collectors.toList()); - return list; - } - - /** - * List all pod names in all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getPods() throws ApiException { - V1PodList v1podList = - COREV1_API.listPodForAllNamespaces( - null, null, null, null, null, null, null, null, null, null); - List podList = - v1podList.getItems().stream() - .map(v1Pod -> v1Pod.getMetadata().getName()) - .collect(Collectors.toList()); - return podList; - } - - /** - * List all pod in the default namespace - * - * @return - * @throws ApiException - */ - public static List getNamespacedPod() throws ApiException { - return getNamespacedPod(DEFAULT_NAME_SPACE, null); - } - - /** - * List pod in specific namespace - * - * @param namespace - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace) throws ApiException { - return getNamespacedPod(namespace, null); - } - - /** - * List pod in specific namespace with label - * - * @param namespace - * @param label - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace, String label) throws ApiException { - V1PodList listNamespacedPod = - COREV1_API.listNamespacedPod( - namespace, - null, - null, - null, - null, - label, - null, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - List listPods = - listNamespacedPod.getItems().stream() - .map(v1pod -> v1pod.getMetadata().getName()) - .collect(Collectors.toList()); - return listPods; - } - - /** - * List all Services in default namespace - * - * @return - * @throws ApiException - */ - public static List getServices() throws ApiException { - V1ServiceList listNamespacedService = - COREV1_API.listNamespacedService( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - return listNamespacedService.getItems().stream() - .map(v1service -> v1service.getMetadata().getName()) - .collect(Collectors.toList()); - } - - /** - * Scale up/down the number of pod in Deployment - * - * @param deploymentName - * @param numberOfReplicas - * @throws ApiException - */ - public static void scaleDeployment(String deploymentName, int numberOfReplicas) - throws ApiException { - AppsV1Api appsV1Api = new AppsV1Api(); - appsV1Api.setApiClient(COREV1_API.getApiClient()); - V1DeploymentList listNamespacedDeployment = - appsV1Api.listNamespacedDeployment( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - null, - Boolean.FALSE); - - List appsV1DeploymentItems = listNamespacedDeployment.getItems(); - Optional findedDeployment = - appsV1DeploymentItems.stream() - .filter( - (V1Deployment deployment) -> - deployment.getMetadata().getName().equals(deploymentName)) - .findFirst(); - findedDeployment.ifPresent( - (V1Deployment deploy) -> { - try { - V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); - V1Deployment newDeploy = deploy.spec(newSpec); - appsV1Api.replaceNamespacedDeployment( - deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); - } catch (ApiException ex) { - LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); - } - }); - } - - /** - * Print out the Log for specific Pods - * - * @param namespace - * @param podName - * @throws ApiException - */ - public static void printLog(String namespace, String podName) throws ApiException { - // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog - String readNamespacedPodLog = - COREV1_API.readNamespacedPodLog( - podName, - namespace, - null, - Boolean.FALSE, - null, - Integer.MAX_VALUE, - null, - Boolean.FALSE, - Integer.MAX_VALUE, - 40, - Boolean.FALSE); - System.out.println(readNamespacedPodLog); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java deleted file mode 100644 index 8e48cc51b3..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/FluentExample.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.Arrays; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" - * - *

From inside $REPO_DIR/examples - */ -public class FluentExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .endContainer() - .endSpec() - .build(); - - api.createNamespacedPod("default", pod, null, null, null, null); - - V1Pod pod2 = - new V1Pod() - .metadata(new V1ObjectMeta().name("anotherpod")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); - - api.createNamespacedPod("default", pod2, null, null, null, null); - - V1PodList list = - api.listNamespacedPod( - "default", null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java deleted file mode 100644 index ddfb1243b8..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/GenericClientExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.util.Arrays; - -public class GenericClientExample { - - public static void main(String[] args) throws Exception { - - // The following codes demonstrates using generic client to manipulate pods - V1Pod pod = - new V1Pod() - .metadata(new V1ObjectMeta().name("foo").namespace("default")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("c").image("test")))); - - ApiClient apiClient = ClientBuilder.standard().build(); - GenericKubernetesApi podClient = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - - V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); - System.out.println("Created!"); - - V1Pod patchedPod = - podClient - .patch( - "default", - "foo", - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) - .throwsApiException() - .getObject(); - System.out.println("Patched!"); - - V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); - if (deletedPod != null) { - System.out.println( - "Received after-deletion status of the requested object, will be deleting in background!"); - } - System.out.println("Deleted!"); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java deleted file mode 100644 index 7ab705b440..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import java.io.IOException; - -/** - * A simple example of how to use the Java API inside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class InClusterClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // loading the in-cluster config, including: - // 1. service-account CA - // 2. service-account bearer-token - // 3. service-account namespace - // 4. master endpoints(ip, port) from pre-set environment variables - ApiClient client = ClientBuilder.cluster().build(); - - // if you prefer not to refresh service account token, please use: - // ApiClient client = ClientBuilder.oldCluster().build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java deleted file mode 100644 index e8bef1ce71..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InformerExample.java +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.informer.ResourceEventHandler; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.CallGeneratorParams; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" - * - *

From inside $REPO_DIR/examples - */ -public class InformerExample { - public static void main(String[] args) throws Exception { - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - SharedInformerFactory factory = new SharedInformerFactory(apiClient); - - // Node informer - SharedIndexInformer nodeInformer = - factory.sharedIndexInformerFor( - // **NOTE**: - // The following "CallGeneratorParams" lambda merely generates a stateless - // HTTPs requests, the effective apiClient is the one specified when constructing - // the informer-factory. - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - - nodeInformer.addEventHandler( - new ResourceEventHandler() { - @Override - public void onAdd(V1Node node) { - System.out.printf("%s node added!\n", node.getMetadata().getName()); - } - - @Override - public void onUpdate(V1Node oldNode, V1Node newNode) { - System.out.printf( - "%s => %s node updated!\n", - oldNode.getMetadata().getName(), newNode.getMetadata().getName()); - } - - @Override - public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { - System.out.printf("%s node deleted!\n", node.getMetadata().getName()); - } - }); - - factory.startAllRegisteredInformers(); - - V1Node nodeToCreate = new V1Node(); - V1ObjectMeta metadata = new V1ObjectMeta(); - metadata.setName("noxu"); - nodeToCreate.setMetadata(metadata); - V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); - Thread.sleep(3000); - - Lister nodeLister = new Lister(nodeInformer.getIndexer()); - V1Node node = nodeLister.get("noxu"); - System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); - factory.stopAllRegisteredInformers(); - Thread.sleep(3000); - System.out.println("informer stopped.."); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java deleted file mode 100644 index c4b15401b0..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.KubeConfig; -import java.io.FileReader; -import java.io.IOException; - -/** - * A simple example of how to use the Java API from an application outside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class KubeConfigFileClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // file path to your KubeConfig - - String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; - - // loading the out-of-cluster config, a kubeconfig from file-system - ApiClient client = - ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java deleted file mode 100644 index 2619c9f271..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/KubectlExample.java +++ /dev/null @@ -1,311 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; -import static io.kubernetes.client.extended.kubectl.Kubectl.copy; -import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.delete; -import static io.kubernetes.client.extended.kubectl.Kubectl.drain; -import static io.kubernetes.client.extended.kubectl.Kubectl.exec; -import static io.kubernetes.client.extended.kubectl.Kubectl.label; -import static io.kubernetes.client.extended.kubectl.Kubectl.log; -import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; -import static io.kubernetes.client.extended.kubectl.Kubectl.scale; -import static io.kubernetes.client.extended.kubectl.Kubectl.taint; -import static io.kubernetes.client.extended.kubectl.Kubectl.top; -import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.version; -import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; - -import io.kubernetes.client.common.KubernetesObject; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.extended.kubectl.KubectlExec; -import io.kubernetes.client.extended.kubectl.KubectlPortForward; -import io.kubernetes.client.extended.kubectl.exception.KubectlException; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1ReplicationController; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.lang3.tuple.Pair; - -/** - * A Java equivalent for the kubectl command line tool. Not nearly as complete. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" - * - *

From inside $REPO_DIR/examples - */ -public class KubectlExample { - static Class getClassForKind(String kind) { - switch (kind) { - case "pod": - case "pods": - return V1Pod.class; - case "deployment": - case "deployments": - return V1Deployment.class; - case "service": - case "services": - return V1Service.class; - case "node": - case "nodes": - return V1Node.class; - case "replicationcontroller": - case "replicationcontrollers": - return V1ReplicationController.class; - } - return null; - } - - private static final String PADDING = " "; - - private static String pad(String value) { - while (value.length() < PADDING.length()) { - value += " "; - } - return value; - } - - public static void main(String[] args) - throws java.io.IOException, KubectlException, ParseException { - ApiClient client = Config.defaultClient(); - - Options options = new Options(); - options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); - options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); - options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); - DefaultParser parser = new DefaultParser(); - CommandLine cli = parser.parse(options, args); - - args = cli.getArgs(); - String verb = args[0]; - String ns = cli.getOptionValue("n", "default"); - String kind = null; - String name = null; - - switch (verb) { - case "delete": - kind = args[1]; - name = args[2]; - delete(getClassForKind(kind)).namespace(ns).name(name).execute(); - case "drain": - name = args[1]; - drain().apiClient(client).name(name).execute(); - System.out.println("Node drained"); - System.exit(0); - case "cordon": - name = args[1]; - cordon().apiClient(client).name(name).execute(); - System.out.println("Node cordoned"); - System.exit(0); - case "uncordon": - name = args[1]; - uncordon().apiClient(client).name(name).execute(); - System.out.println("Node uncordoned"); - System.exit(0); - case "top": - String what = args[1]; - switch (what) { - case "nodes": - case "node": - List> nodes = - top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); - System.out.println(pad("Node") + "\tCPU\t\tMemory"); - for (Pair node : nodes) { - System.out.println( - pad(node.getLeft().getMetadata().getName()) - + "\t" - + node.getRight().getUsage().get("cpu").getNumber() - + "\t" - + node.getRight().getUsage().get("memory").getNumber()); - } - System.exit(0); - case "pods": - case "pod": - List> pods = - top(V1Pod.class, PodMetrics.class) - .apiClient(client) - .namespace(ns) - .metric("cpu") - .execute(); - System.out.println(pad("Pod") + "\tCPU\t\tMemory"); - for (Pair pod : pods) { - System.out.println( - pad(pod.getLeft().getMetadata().getName()) - + "\t" - + podMetricSum(pod.getRight(), "cpu") - + "\t" - + podMetricSum(pod.getRight(), "memory")); - } - System.exit(0); - } - System.err.println("Unknown top argument: " + what); - System.exit(-1); - case "cp": - String from = args[1]; - String to = args[2]; - if (from.indexOf(":") != -1) { - String[] parts = from.split(":"); - name = parts[0]; - from = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .fromPod(from) - .to(to) - .execute(); - } else if (to.indexOf(":") != -1) { - String[] parts = to.split(":"); - name = parts[0]; - to = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .from(from) - .toPod(to) - .execute(); - } else { - System.err.println("Missing pod name for copy."); - System.exit(-1); - } - System.out.println("Copied " + from + " -> " + to); - System.exit(0); - case "taint": - name = args[1]; - String taintSpec = args[2]; - boolean remove = taintSpec.endsWith("-"); - int ix = taintSpec.indexOf("="); - int ix2 = taintSpec.indexOf(":"); - - if (remove) { - taintSpec = taintSpec.substring(0, taintSpec.length() - 2); - String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); - String effect = ix == -1 ? null : taintSpec.substring(ix + 1); - - if (effect == null) { - taint().apiClient(client).name(name).removeTaint(key).execute(); - } else { - taint().apiClient(client).name(name).removeTaint(key, effect).execute(); - } - System.exit(0); - } - if (ix2 == -1) { - System.err.println("key:effect or key=value:effect is required."); - System.exit(-1); - } - String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); - String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); - String effect = taintSpec.substring(ix2 + 1); - - if (value == null) { - taint().apiClient(client).name(name).addTaint(key, effect).execute(); - } else { - taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); - } - System.exit(0); - case "portforward": - name = args[1]; - KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); - for (int i = 2; i < args.length; i++) { - String port = args[i]; - String[] ports = port.split(":"); - System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); - forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); - } - forward.execute(); - System.exit(0); - case "log": - name = args[1]; - Streams.copy( - log() - .apiClient(client) - .name(name) - .namespace(ns) - .container(cli.getOptionValue("c", "")) - .execute(), - System.out); - System.exit(0); - case "scale": - kind = args[1]; - name = args[2]; - if (!cli.hasOption("r")) { - System.err.println("--replicas is required"); - System.exit(-3); - } - int replicas = Integer.parseInt(cli.getOptionValue("r")); - scale(getClassForKind(kind)) - .apiClient(client) - .namespace(ns) - .name(name) - .replicas(replicas) - .execute(); - System.out.println("Deployment scaled."); - System.exit(0); - case "version": - System.out.println(version().apiClient(client)); - System.exit(0); - case "label": - kind = args[1]; - name = args[2]; - String labelKey = args[3]; - String labelValue = args[4]; - Class clazz = getClassForKind(kind); - if (clazz == null) { - System.err.println("Unknown kind: " + kind); - System.exit(-2); - } - label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); - System.exit(0); - case "exec": - name = args[1]; - String[] command = Arrays.copyOfRange(args, 2, args.length); - KubectlExec e = - exec() - .apiClient(client) - .namespace(ns) - .name(name) - .command(command) - .container(cli.getOptionValue("c", "")); - System.exit(e.execute()); - case "api-resources": - apiResources().apiClient(client).execute().stream() - .forEach( - r -> - System.out.printf( - "%s\t\t%s\t\t%s\t\t%s\n", - r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); - System.exit(0); - default: - System.out.println("Unknown verb: " + verb); - System.exit(-1); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java deleted file mode 100644 index 0e48689602..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.time.Duration; -import java.util.UUID; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" - * - *

From inside $REPO_DIR/examples - */ -public class LeaderElectionExample { - public static void main(String[] args) throws Exception { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // New - String appNamespace = "default"; - String appName = "leader-election-foobar"; - String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique - EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); - - LeaderElectionConfig leaderElectionConfig = - new LeaderElectionConfig( - lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); - try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { - leaderElector.run( - () -> { - System.out.println("Do something when getting leadership."); - }, - () -> { - System.out.println("Do something when losing leadership."); - }); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java deleted file mode 100644 index e1df5964d3..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/LogsExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PodLogs; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.io.InputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" - * - *

From inside $REPO_DIR/examples - */ -public class LogsExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - CoreV1Api coreApi = new CoreV1Api(client); - - PodLogs logs = new PodLogs(); - V1Pod pod = - coreApi - .listNamespacedPod( - "default", "false", null, null, null, null, null, null, null, null, null) - .getItems() - .get(0); - - InputStream is = logs.streamNamespacedPodLog(pod); - Streams.copy(is, System.out); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java deleted file mode 100644 index 0d8c10e30b..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/MetricsExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Metrics; -import io.kubernetes.client.custom.ContainerMetrics; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.NodeMetricsList; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" - * - *

From inside $REPO_DIR/examples - */ -public class MetricsExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Metrics metrics = new Metrics(client); - NodeMetricsList list = metrics.getNodeMetrics(); - for (NodeMetrics item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - for (String key : item.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + item.getUsage().get(key)); - } - System.out.println(); - } - - for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - if (item.getContainers() == null) { - continue; - } - for (ContainerMetrics container : item.getContainers()) { - System.out.println(container.getName()); - System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - for (String key : container.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + container.getUsage().get(key)); - } - System.out.println(); - } - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java deleted file mode 100644 index b0a4ac4fa4..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PagerExample.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.pager.Pager; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" - * - *

From inside $REPO_DIR/examples - */ -public class PagerExample { - public static void main(String[] args) throws IOException { - - ApiClient client = Config.defaultClient(); - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - CoreV1Api api = new CoreV1Api(); - int i = 0; - Pager pager = - new Pager( - (Pager.PagerParams param) -> { - try { - return api.listNamespaceCall( - null, - null, - param.getContinueToken(), - null, - null, - param.getLimit(), - null, - null, - 1, - null, - null); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, - client, - 10, - V1NamespaceList.class); - for (V1Namespace namespace : pager) { - System.out.println(namespace.getMetadata().getName()); - } - System.out.println("------------------"); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java deleted file mode 100644 index 92866a46fe..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ParseExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" - * - *

From inside $REPO_DIR/examples - */ -public class ParseExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - if (args.length < 2) { - System.err.println("Usage: ParseExample "); - System.exit(1); - } - ApiClient client = Config.defaultClient(); - FileReader json = new FileReader(args[0]); - Object obj = - client - .getJSON() - .getGson() - .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); - - String output = client.getJSON().getGson().toJson(obj); - - // Test round tripping... - Object obj2 = - client - .getJSON() - .getGson() - .fromJson( - new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); - - String output2 = client.getJSON().getGson().toJson(obj2); - - // Validate round trip - if (!output.equals(output2)) { - System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); - System.exit(2); - } - - System.out.println(output); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java deleted file mode 100644 index 7eed3360d3..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.PatchUtils; -import java.io.IOException; - -/** - * A simple Example of how to use the Java API.
- * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
- * For generating Json Patches, refer http://jsonpatch.com. For - * generating Strategic Merge Patches, refer strategic-merge-patch.md. - * - *

    - *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a - * finalizer. - *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. - *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. - *
- * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" - * - *

From inside $REPO_DIR/examples - */ -public class PatchExample { - static String jsonPatchStr = - "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; - static String strategicMergePatchStr = - "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; - static String jsonDeploymentStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - static String applyYamlStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - - public static void main(String[] args) throws IOException { - try { - AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); - V1Deployment body = - Configuration.getDefaultApiClient() - .getJSON() - .deserialize(jsonDeploymentStr, V1Deployment.class); - - // create a deployment - V1Deployment deploy1 = - api.createNamespacedDeployment("default", body, null, null, null, null); - System.out.println("original deployment" + deploy1); - - // json-patch a deployment - V1Deployment deploy2 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(jsonPatchStr), - null, - null, - null, - null, // field-manager is optional - null, - null), - V1Patch.PATCH_FORMAT_JSON_PATCH, - api.getApiClient()); - System.out.println("json-patched deployment" + deploy2); - - // strategic-merge-patch a deployment - V1Deployment deploy3 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(strategicMergePatchStr), - null, - null, - null, // field-manager is optional - null, - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - api.getApiClient()); - System.out.println("strategic-merge-patched deployment" + deploy3); - - // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 - // or opt-in by turning on the feature gate for v1.14 or v1.15. - // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply - V1Deployment deploy4 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(applyYamlStr), - null, - null, - "example-field-manager", // field-manager is required for server-side apply - null, - true, - null), - V1Patch.PATCH_FORMAT_APPLY_YAML, - api.getApiClient()); - System.out.println("application/apply-patch+yaml deployment" + deploy4); - - } catch (ApiException e) { - System.out.println(e.getResponseBody()); - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java deleted file mode 100644 index cbe064db31..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PortForwardExample.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PortForward; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.List; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside - * $REPO_DIR/examples - * - *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times - * out pretty fast...) - */ -public class PortForwardExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - PortForward forward = new PortForward(); - List ports = new ArrayList<>(); - int localPort = 8080; - int targetPort = 8080; - ports.add(targetPort); - final PortForward.PortForwardResult result = - forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); - System.out.println("Forwarding!"); - ServerSocket ss = new ServerSocket(localPort); - - final Socket s = ss.accept(); - System.out.println("Connected!"); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - - System.exit(0); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java deleted file mode 100644 index 65f38b8ce4..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PromOpExample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.coreos.monitoring.models.V1Prometheus; -import com.coreos.monitoring.models.V1PrometheusList; -import com.coreos.monitoring.models.V1PrometheusSpec; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -public class PromOpExample { - public static void main(String[] args) throws IOException, ApiException { - GenericKubernetesApi prometheusApi = - new GenericKubernetesApi<>( - V1Prometheus.class, - V1PrometheusList.class, - "monitoring.coreos.com", - "v1", - "prometheuses", - ClientBuilder.defaultClient()); - prometheusApi - .create( - new V1Prometheus() - .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) - .kind("Prometheus") - .apiVersion("monitoring.coreos.com/v1") - .spec(new V1PrometheusSpec())) - .throwsApiException(); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java deleted file mode 100644 index a365704030..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PrometheusExample.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.monitoring.Monitoring; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API with Prometheus metrics - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" - * - *

From inside $REPO_DIR/examples - */ -public class PrometheusExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // Install an HTTP Interceptor that adds metrics - Monitoring.installMetrics(client); - - // Install a simple HTTP server to serve prometheus metrics. If you already are serving - // metrics elsewhere, this is unnecessary. - Monitoring.startMetricsServer("localhost", 8080); - - CoreV1Api api = new CoreV1Api(); - - while (true) { - // A request that should return 200 - V1PodList list = - api.listPodForAllNamespaces( null, null, null, null, null, null, null, null, null, null); - // A request that should return 404 - try { - V1Pod pod = api.readNamespacedPod("foo", "bar", null); - } catch (ApiException ex) { - if (ex.getCode() != 404) { - throw ex; - } - } - try { - Thread.sleep(10000); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java deleted file mode 100644 index e4e05a2aa1..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/ProtoExample.java +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.ProtoClient; -import io.kubernetes.client.ProtoClient.ObjectOrStatus; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.proto.Meta.ObjectMeta; -import io.kubernetes.client.proto.V1.Namespace; -import io.kubernetes.client.proto.V1.NamespaceSpec; -import io.kubernetes.client.proto.V1.Pod; -import io.kubernetes.client.proto.V1.PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" - * - *

From inside $REPO_DIR/examples - */ -public class ProtoExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - ProtoClient pc = new ProtoClient(client); - ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); - - if (list.object.getItemsCount() > 0) { - Pod p = list.object.getItems(0); - System.out.println(p); - } - - Namespace namespace = - Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); - - ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); - System.out.println(ns); - if (ns.object != null) { - namespace = - ns.object - .toBuilder() - .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) - .build(); - // This is how you would update an object, but you can't actually - // update namespaces, so this returns a 405 - ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); - System.out.println(ns.status); - } - - ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); - System.out.println(ns); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java deleted file mode 100644 index f6494a836e..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.openapi.models.V1EndpointsList; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.time.Duration; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; - -@SpringBootApplication -public class SpringControllerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringControllerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner commandLineRunner( - SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("running controller.."); - nodePrintingController.run(); - }; - } - - @Bean - public Controller nodePrintingController( - SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { - DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); - builder = - builder.watch( - (q) -> { - return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) - .withResyncPeriod(Duration.ofMinutes(1)) - .build(); - }); - builder.withWorkerCount(2); - builder.withReadyFunc(reconciler::informerReady); - return builder.withReconciler(reconciler).withName("nodePrintingController").build(); - } - - @Bean - public SharedIndexInformer endpointsInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>( - V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); - } - - @Bean - public SharedIndexInformer nodeInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); - } - - @Bean - public SharedIndexInformer podInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); - } - } - - @Component - public static class NodePrintingReconciler implements Reconciler { - - @Value("${namespace}") - private String namespace; - - private SharedInformer nodeInformer; - - private SharedInformer podInformer; - - private Lister nodeLister; - - private Lister podLister; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { - this.nodeInformer = nodeInformer; - this.podInformer = podInformer; - this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); - this.podLister = new Lister<>(podInformer.getIndexer(), namespace); - } - - // *OPTIONAL* - // If you want to hold the controller from running util some condition.. - public boolean informerReady() { - return podInformer.hasSynced() && nodeInformer.hasSynced(); - } - - @Override - public Result reconcile(Request request) { - V1Node node = nodeLister.get(request.getName()); - - System.out.println("get all pods in namespace " + namespace); - podLister.namespace(namespace).list().stream() - .map(pod -> pod.getMetadata().getName()) - .forEach(System.out::println); - - System.out.println("triggered reconciling " + node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java deleted file mode 100644 index bafe11e421..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.network.EndpointsLoadBalancer; -import io.kubernetes.client.extended.network.LoadBalancer; -import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@SpringBootApplication -public class SpringLoadBalancerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringLoadBalancerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner loadBalancerCommandLineRunner( - SharedInformerFactory sharedInformerFactory, MyService myService) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("routing default/kubernetes:"); - System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); - }; - } - - @Bean - public MyService myService(SharedIndexInformer lister) { - return new MyService(new Lister<>(lister.getIndexer())); - } - } - - public static class MyService { - - private LoadBalancer defaultKubernetesLoadBalancer; - - public MyService(Lister lister) { - InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); - RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); - defaultKubernetesLoadBalancer = - new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java deleted file mode 100644 index 23ecce52d5..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WatchExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.google.gson.reflect.TypeToken; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Watch; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** A simple example of how to use Watch API to watch changes in Namespace list. */ -public class WatchExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - // infinite timeout - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - Watch watch = - Watch.createWatch( - client, - api.listNamespaceCall( - null, null, null, null, null, null, null, null, null, Boolean.TRUE, null), - new TypeToken>() {}.getType()); - - try { - for (Watch.Response item : watch) { - System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); - } - } finally { - watch.close(); - } - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java deleted file mode 100644 index e1f54dcd07..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.WebSockets; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import okhttp3.WebSocket; - -/** - * This is a pretty low level, most people won't need to use WebSockets directly. - * - *

If you do need to run it, you can run: mvn exec:java \ - * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ - * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true - * - *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP - * GET calls. - */ -public class WebSocketsExample { - public static void main(String... args) throws ApiException, IOException { - final ApiClient client = Config.defaultClient(); - WebSockets.stream( - args[0], - "GET", - client, - new WebSockets.SocketListener() { - private volatile WebSocket socket; - - @Override - public void open(String protocol, WebSocket socket) { - this.socket = socket; - } - - @Override - public void close() {} - - @Override - public void bytesMessage(InputStream is) {} - - @Override - public void failure(Throwable t) { - t.printStackTrace(); - } - - @Override - public void textMessage(Reader in) { - try { - BufferedReader reader = new BufferedReader(in); - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - System.out.println(line); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - } -} diff --git a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java deleted file mode 100644 index b3f0dc6626..0000000000 --- a/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/YamlExample.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.IntOrString; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.openapi.models.V1ServiceBuilder; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Yaml; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" - * - *

From inside $REPO_DIR/examples - */ -public class YamlExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .withNewResources() - .withLimits(new HashMap<>()) - .endResources() - .endContainer() - .endSpec() - .build(); - System.out.println(Yaml.dump(pod)); - - V1Service svc = - new V1ServiceBuilder() - .withNewMetadata() - .withName("aservice") - .endMetadata() - .withNewSpec() - .withSessionAffinity("ClientIP") - .withType("NodePort") - .addNewPort() - .withProtocol("TCP") - .withName("client") - .withPort(8008) - .withNodePort(8080) - .withTargetPort(new IntOrString(8080)) - .endPort() - .endSpec() - .build(); - System.out.println(Yaml.dump(svc)); - - // Read yaml configuration file, and deploy it - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // See issue #474. Not needed at most cases, but it is needed if you are using war - // packging or running this on JUnit. - Yaml.addModelMap("v1", "Service", V1Service.class); - - // Example yaml file can be found in $REPO_DIR/test-svc.yaml - File file = new File("test-svc.yaml"); - V1Service yamlSvc = (V1Service) Yaml.load(file); - - // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of - // CoreV1API - CoreV1Api api = new CoreV1Api(); - V1Service createResult = - api.createNamespacedService("default", yamlSvc, null, null, null, null); - - System.out.println(createResult); - - V1Service deleteResult = - api.deleteNamespacedService( - yamlSvc.getMetadata().getName(), - "default", - null, - null, - null, - null, - null, - new V1DeleteOptions()); - System.out.println(deleteResult); - } -} diff --git a/examples/examples-release-18/src/main/resources/application.properties b/examples/examples-release-18/src/main/resources/application.properties deleted file mode 100644 index dc886e5f48..0000000000 --- a/examples/examples-release-18/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -namespace=airflow -management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java deleted file mode 100644 index df2f168e41..0000000000 --- a/examples/examples-release-18/src/test/java/io/kubernetes/client/examples/ExampleTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertEquals; - -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; -import org.junit.Rule; -import org.junit.Test; - -public class ExampleTest { - private static final int PORT = 8089; - @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); - - @Test - public void exactUrlOnly() throws IOException, ApiException { - ApiClient client = new ApiClient(); - client.setBasePath("http://localhost:" + PORT); - Configuration.setDefaultApiClient(client); - - V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); - - stubFor( - get(urlEqualTo("/api/v1/namespaces/name")) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBody(client.getJSON().serialize(ns1)))); - - CoreV1Api api = new CoreV1Api(); - V1Namespace ns2 = api.readNamespace("name", null); - assertEquals(ns1, ns2); - } -} diff --git a/examples/examples-release-18/test-svc.yaml b/examples/examples-release-18/test-svc.yaml deleted file mode 100644 index f225bea76f..0000000000 --- a/examples/examples-release-18/test-svc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: test-service -spec: - type: ClusterIP - selector: - app: test-service - ports: - - name: port-of-container - port: 8080 \ No newline at end of file diff --git a/examples/examples-release-18/test.yaml b/examples/examples-release-18/test.yaml deleted file mode 100644 index 0b46e57003..0000000000 --- a/examples/examples-release-18/test.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: test -spec: - replicas: 1 - template: - metadata: - labels: - app: test - spec: - containers: - - name: test - image: test/examples:1.0 - command: ["/bin/sh","-c"] - args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/examples/examples-release-19/Dockerfile b/examples/examples-release-19/Dockerfile deleted file mode 100644 index ac90eb1d67..0000000000 --- a/examples/examples-release-19/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8-jre - -COPY target/client-java-examples-*-SNAPSHOT-jar-with-dependencies.jar /examples.jar - -CMD ["java", "-jar", "/examples.jar"] - - diff --git a/examples/examples-release-19/README.md b/examples/examples-release-19/README.md deleted file mode 100644 index 80c34ea272..0000000000 --- a/examples/examples-release-19/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Running examples - -```sh -export REPO_ROOT=/path/to/client-java/repo - -cd ${REPO_ROOT}/ -mvn install - -cd ${REPO_ROOT}/examples/examples-15 -mvn compile -mvn exec:java -Dexec.mainClass="io.kubernetes.client.examples.Example" -``` - diff --git a/examples/examples-release-19/createPod.sh b/examples/examples-release-19/createPod.sh deleted file mode 100755 index 18a9841317..0000000000 --- a/examples/examples-release-19/createPod.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# creates a pod and runs -# Example.java(list pods for all namespaces) on starting of pod - -# Exit on any error. -set -e - -if ! which minikube > /dev/null; then - echo "This script requires minikube installed." - exit 100 -fi - -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -export REPO_ROOT=${dir}/.. - -cd ${REPO_ROOT} -mvn install - -cd ${REPO_ROOT}/examples -mvn package - -eval $(minikube docker-env) -docker build -t test/examples:1.0 . -kubectl apply -f test.yaml diff --git a/examples/examples-release-19/pom.xml b/examples/examples-release-19/pom.xml deleted file mode 100644 index b6703d369e..0000000000 --- a/examples/examples-release-19/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - 4.0.0 - - - io.kubernetes - client-java-examples-parent - 25.0.0-legacy-SNAPSHOT - .. - - - client-java-examples-release-19 - client-java-examples-release-19 - - - - ch.qos.logback - logback-classic - runtime - - - io.prometheus - simpleclient - 0.16.0 - - - io.prometheus - simpleclient_httpserver - 0.16.0 - - - io.kubernetes - client-java-api - ${project.version} - - - io.kubernetes - client-java - ${project.version} - - - io.kubernetes - client-java-extended - ${project.version} - - - io.kubernetes - client-java-spring-integration - ${project.version} - - - io.kubernetes - client-java-proto - ${project.version} - - - commons-cli - commons-cli - - - io.kubernetes - client-java-cert-manager-models - 10.0.1 - - - io.kubernetes - client-java-prometheus-operator-models - 10.0.1 - - - - junit - junit - test - - - com.github.tomakehurst - wiremock - test - - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-actuator - ${spring.boot.version} - - - com.amazonaws - aws-java-sdk-sts - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - - diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java deleted file mode 100644 index 7f753b8d8f..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/AttachExample.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Attach; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.AttachExample" - * - *

From inside $REPO_DIR/examples - */ -public class AttachExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Attach attach = new Attach(); - final Attach.AttachResult result = attach.attach("default", "nginx-4217019353-k5sn9", true); - - new Thread( - new Runnable() { - public void run() { - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - OutputStream output = result.getStandardInputStream(); - try { - while (true) { - String line = in.readLine(); - output.write(line.getBytes()); - output.write('\n'); - output.flush(); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getStandardOutputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - result.close(); - System.exit(0); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java deleted file mode 100644 index b616a18ee9..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CertManagerExample.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.cert.manager.models.V1alpha2IssuerSpecSelfSigned; -import io.cert.manager.models.V1beta1Issuer; -import io.cert.manager.models.V1beta1IssuerList; -import io.cert.manager.models.V1beta1IssuerSpec; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -/** - * This sample creates a self signed issuer "self-signed-issuer" in default namespace on a - * Kubernetes cluster where cert-manager is installed - */ -public class CertManagerExample { - public static void main(String[] args) throws IOException { - GenericKubernetesApi issuerApi = - new GenericKubernetesApi<>( - V1beta1Issuer.class, - V1beta1IssuerList.class, - "cert-manager.io", - "v1beta1", - "issuers", - ClientBuilder.defaultClient()); - issuerApi.create( - new V1beta1Issuer() - .metadata(new V1ObjectMeta().namespace("default").name("self-signed-issuer")) - .kind("Issuer") - .apiVersion("cert-manager.io/v1beta1") - .spec(new V1beta1IssuerSpec().selfSigned(new V1alpha2IssuerSpecSelfSigned()))); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java deleted file mode 100644 index 07e539e854..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ControllerExample.java +++ /dev/null @@ -1,164 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.ControllerManager; -import io.kubernetes.client.extended.controller.LeaderElectingController; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.extended.event.EventType; -import io.kubernetes.client.extended.event.legacy.EventBroadcaster; -import io.kubernetes.client.extended.event.legacy.EventRecorder; -import io.kubernetes.client.extended.event.legacy.LegacyEventBroadcaster; -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1EventSource; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.util.CallGeneratorParams; -import java.io.IOException; -import java.time.Duration; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -public class ControllerExample { - public static void main(String[] args) throws IOException { - - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - // instantiating an informer-factory, and there should be only one informer-factory - // globally. - SharedInformerFactory informerFactory = new SharedInformerFactory(); - // registering node-informer into the informer-factory. - SharedIndexInformer nodeInformer = - informerFactory.sharedIndexInformerFor( - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - informerFactory.startAllRegisteredInformers(); - - EventBroadcaster eventBroadcaster = new LegacyEventBroadcaster(coreV1Api); - - // nodeReconciler prints node information on events - NodePrintingReconciler nodeReconciler = - new NodePrintingReconciler( - nodeInformer, - eventBroadcaster.newRecorder( - new V1EventSource().host("localhost").component("node-printer"))); - - // Use builder library to construct a default controller. - Controller controller = - ControllerBuilder.defaultBuilder(informerFactory) - .watch( - (workQueue) -> - ControllerBuilder.controllerWatchBuilder(V1Node.class, workQueue) - .withWorkQueueKeyFunc( - (V1Node node) -> - new Request(node.getMetadata().getName())) // optional, default to - .withOnAddFilter( - (V1Node createdNode) -> - createdNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onAdd filter - .withOnUpdateFilter( - (V1Node oldNode, V1Node newNode) -> - newNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onUpdate filter - .withOnDeleteFilter( - (V1Node deletedNode, Boolean stateUnknown) -> - deletedNode - .getMetadata() - .getName() - .startsWith("docker-")) // optional, set onDelete filter - .build()) - .withReconciler(nodeReconciler) // required, set the actual reconciler - .withName("node-printing-controller") // optional, set name for controller - .withWorkerCount(4) // optional, set worker thread count - .withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the - // cache has synced up - .build(); - - // Use builder library to manage one or multiple controllers. - ControllerManager controllerManager = - ControllerBuilder.controllerManagerBuilder(informerFactory) - .addController(controller) - .build(); - - LeaderElectingController leaderElectingController = - new LeaderElectingController( - new LeaderElector( - new LeaderElectionConfig( - new EndpointsLock("kube-system", "leader-election", "foo"), - Duration.ofMillis(10000), - Duration.ofMillis(8000), - Duration.ofMillis(5000))), - controllerManager); - - leaderElectingController.run(); - } - - static class NodePrintingReconciler implements Reconciler { - - private Lister nodeLister; - private EventRecorder eventRecorder; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, EventRecorder recorder) { - this.nodeLister = new Lister<>(nodeInformer.getIndexer()); - this.eventRecorder = recorder; - } - - @Override - public Result reconcile(Request request) { - V1Node node = this.nodeLister.get(request.getName()); - System.out.println("triggered reconciling " + node.getMetadata().getName()); - this.eventRecorder.event( - node, - EventType.Normal, - "Print Node", - "Successfully printed %s", - node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java deleted file mode 100644 index bbb6575676..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/CopyExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Copy; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import io.kubernetes.client.util.exception.CopyNotSupportedException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Paths; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.CopyExample" - * - *

From inside $REPO_DIR/examples - */ -public class CopyExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, CopyNotSupportedException { - String podName = "kube-addon-manager-minikube"; - String namespace = "kube-system"; - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Copy copy = new Copy(); - InputStream dataStream = copy.copyFileFromPod(namespace, podName, "/etc/motd"); - Streams.copy(dataStream, System.out); - - copy.copyDirectoryFromPod(namespace, podName, null, "/etc", Paths.get("/tmp/etc")); - - System.out.println("Done!"); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java deleted file mode 100644 index 42a2524f7b..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DeployRolloutRestartExample.java +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentBuilder; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1LabelSelector; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.openapi.models.V1PodTemplateSpec; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.PatchUtils; -import io.kubernetes.client.util.wait.Wait; -import java.io.IOException; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.Collections; - -public class DeployRolloutRestartExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - AppsV1Api appsV1Api = new AppsV1Api(client); - - String deploymentName = "example-nginx"; - String imageName = "nginx:1.21.6"; - String namespace = "default"; - - // Create an example deployment - V1DeploymentBuilder deploymentBuilder = - new V1DeploymentBuilder() - .withApiVersion("apps/v1") - .withKind("Deployment") - .withMetadata(new V1ObjectMeta().name(deploymentName).namespace(namespace)) - .withSpec( - new V1DeploymentSpec() - .replicas(1) - .selector(new V1LabelSelector().putMatchLabelsItem("name", deploymentName)) - .template( - new V1PodTemplateSpec() - .metadata(new V1ObjectMeta().putLabelsItem("name", deploymentName)) - .spec( - new V1PodSpec() - .containers( - Collections.singletonList( - new V1Container() - .name(deploymentName) - .image(imageName)))))); - appsV1Api.createNamespacedDeployment( - namespace, deploymentBuilder.build(), null, null, null, null); - - // Wait until example deployment is ready - Wait.poll( - Duration.ofSeconds(3), - Duration.ofSeconds(60), - () -> { - try { - System.out.println("Waiting until example deployment is ready..."); - return appsV1Api - .readNamespacedDeployment(deploymentName, namespace, null) - .getStatus() - .getReadyReplicas() - > 0; - } catch (ApiException e) { - e.printStackTrace(); - return false; - } - }); - System.out.println("Created example deployment!"); - - // Trigger a rollout restart of the example deployment - V1Deployment runningDeployment = - appsV1Api.readNamespacedDeployment(deploymentName, namespace, null); - - // Explicitly set "restartedAt" annotation with current date/time to trigger rollout when patch - // is applied - runningDeployment - .getSpec() - .getTemplate() - .getMetadata() - .putAnnotationsItem("kubectl.kubernetes.io/restartedAt", LocalDateTime.now().toString()); - try { - String deploymentJson = client.getJSON().serialize(runningDeployment); - - PatchUtils.patch( - V1Deployment.class, - () -> - appsV1Api.patchNamespacedDeploymentCall( - deploymentName, - namespace, - new V1Patch(deploymentJson), - null, - null, - "kubectl-rollout", - null, - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - client); - - // Wait until deployment has stabilized after rollout restart - Wait.poll( - Duration.ofSeconds(3), - Duration.ofSeconds(60), - () -> { - try { - System.out.println("Waiting until example deployment restarted successfully..."); - return appsV1Api - .readNamespacedDeployment(deploymentName, namespace, null) - .getStatus() - .getReadyReplicas() - > 0; - } catch (ApiException e) { - e.printStackTrace(); - return false; - } - }); - System.out.println("Example deployment restarted successfully!"); - } catch (ApiException e) { - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java deleted file mode 100644 index b8cb04616d..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/DynamicClientExample.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesApi; -import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject; -import java.io.IOException; - -public class DynamicClientExample { - - public static void main(String[] args) throws IOException, ApiException { - - ApiClient apiClient = ClientBuilder.standard().build(); - - // retrieving the latest state of the default namespace - DynamicKubernetesApi dynamicApi = new DynamicKubernetesApi("", "v1", "namespaces", apiClient); - DynamicKubernetesObject defaultNamespace = - dynamicApi.get("default").throwsApiException().getObject(); - - // attaching a "foo=bar" label to the default namespace - defaultNamespace.setMetadata(defaultNamespace.getMetadata().putLabelsItem("foo", "bar")); - DynamicKubernetesObject updatedDefaultNamespace = - dynamicApi.update(defaultNamespace).throwsApiException().getObject(); - - System.out.println(updatedDefaultNamespace); - - apiClient.getHttpClient().connectionPool().evictAll(); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java deleted file mode 100644 index e1e6610a2a..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/EKSAuthenticationExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; -import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.models.VersionInfo; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.credentials.EKSAuthentication; -import io.kubernetes.client.util.version.Version; - -import java.io.IOException; - -public class EKSAuthenticationExample { - public static void main(String[] args) throws IOException, ApiException { - - // Connecting an EKS cluster using {@link io.kubernetes.client.util.credentials.EKSAuthentication } - - // This role should have access to the EKS cluster. - String roleArn = "arn:aws:iam::123456789:role/TestRole"; - // Arbitrary role session name. - String roleSessionName = "test"; - // Region where the EKS cluster at. - String region = "us-west-2"; - // EKS cluster name. - String clusterName = "test-2"; - - STSAssumeRoleSessionCredentialsProvider credProvider = new STSAssumeRoleSessionCredentialsProvider( - new DefaultAWSCredentialsProviderChain().getCredentials(), - roleArn, - roleSessionName); - - ApiClient apiClient = ClientBuilder.standard() - .setAuthentication(new EKSAuthentication(credProvider, region, clusterName)) - .build(); - - Version version = new Version(apiClient); - VersionInfo versionInfo = version.getVersion(); - System.out.println(versionInfo); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java deleted file mode 100644 index ef97e240d1..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/Example.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.Example" - * - *

From inside $REPO_DIR/examples - */ -public class Example { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java deleted file mode 100644 index acea8e815a..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExecExample.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Exec; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExecExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExecExample { - public static void main(String[] args) - throws IOException, ApiException, InterruptedException, ParseException { - final Options options = new Options(); - options.addOption(new Option("p", "pod", true, "The name of the pod")); - options.addOption(new Option("n", "namespace", true, "The namespace of the pod")); - - CommandLineParser parser = new DefaultParser(); - CommandLine cmd = parser.parse(options, args); - - String podName = cmd.getOptionValue("p", "nginx-dbddb74b8-s4cx5"); - String namespace = cmd.getOptionValue("n", "default"); - args = cmd.getArgs(); - - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Exec exec = new Exec(); - boolean tty = System.console() != null; - // final Process proc = exec.exec("default", "nginx-4217019353-k5sn9", new String[] - // {"sh", "-c", "echo foo"}, true, tty); - final Process proc = - exec.exec(namespace, podName, args.length == 0 ? new String[] {"sh"} : args, true, tty); - - Thread in = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(System.in, proc.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - in.start(); - - Thread out = - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(proc.getInputStream(), System.out); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - out.start(); - - proc.waitFor(); - - // wait for any last output; no need to wait for input thread - out.join(); - - proc.destroy(); - - System.exit(proc.exitValue()); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java deleted file mode 100644 index cea509a0fc..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ExpandedExample.java +++ /dev/null @@ -1,278 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1DeploymentList; -import io.kubernetes.client.openapi.models.V1DeploymentSpec; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1ServiceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ExpandedExample" - * - *

From inside $REPO_DIR/examples - */ -public class ExpandedExample { - - private static CoreV1Api COREV1_API; - private static final String DEFAULT_NAME_SPACE = "default"; - private static final Integer TIME_OUT_VALUE = 180; - private static final Logger LOGGER = LoggerFactory.getLogger(ExpandedExample.class); - - /** - * Main method - * - * @param args - */ - public static void main(String[] args) { - try { - ApiClient client = Config.defaultClient(); - // To change the context of k8s cluster, you can use - // io.kubernetes.client.util.KubeConfig - Configuration.setDefaultApiClient(client); - COREV1_API = new CoreV1Api(client); - - // ScaleUp/ScaleDown the Deployment pod - // Please change the name of Deployment? - System.out.println("----- Scale Deployment Start -----"); - scaleDeployment("account-service", 5); - - // List all of the namaspaces and pods - List nameSpaces = getAllNameSpaces(); - nameSpaces.stream() - .forEach( - namespace -> { - try { - System.out.println("----- " + namespace + " -----"); - getNamespacedPod(namespace).stream().forEach(System.out::println); - } catch (ApiException ex) { - LOGGER.warn("Couldn't get the pods in namespace:" + namespace, ex); - } - }); - - // Print all of the Services - System.out.println("----- Print list all Services Start -----"); - List services = getServices(); - services.stream().forEach(System.out::println); - System.out.println("----- Print list all Services End -----"); - - // Print log of specific pod. In this example show the first pod logs. - System.out.println("----- Print Log of Specific Pod Start -----"); - String firstPodName = getPods().get(0); - printLog(DEFAULT_NAME_SPACE, firstPodName); - System.out.println("----- Print Log of Specific Pod End -----"); - } catch (ApiException | IOException ex) { - LOGGER.warn("Exception had occured ", ex); - } - } - - /** - * Get all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getAllNameSpaces() throws ApiException { - V1NamespaceList listNamespace = - COREV1_API.listNamespace( - null, null, null, null, null, null, null, null, null, null, null); - List list = - listNamespace.getItems().stream() - .map(v1Namespace -> v1Namespace.getMetadata().getName()) - .collect(Collectors.toList()); - return list; - } - - /** - * List all pod names in all namespaces in k8s cluster - * - * @return - * @throws ApiException - */ - public static List getPods() throws ApiException { - V1PodList v1podList = - COREV1_API.listPodForAllNamespaces( - null, null, null, null, null, null, null, null, null, null, null); - List podList = - v1podList.getItems().stream() - .map(v1Pod -> v1Pod.getMetadata().getName()) - .collect(Collectors.toList()); - return podList; - } - - /** - * List all pod in the default namespace - * - * @return - * @throws ApiException - */ - public static List getNamespacedPod() throws ApiException { - return getNamespacedPod(DEFAULT_NAME_SPACE, null); - } - - /** - * List pod in specific namespace - * - * @param namespace - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace) throws ApiException { - return getNamespacedPod(namespace, null); - } - - /** - * List pod in specific namespace with label - * - * @param namespace - * @param label - * @return - * @throws ApiException - */ - public static List getNamespacedPod(String namespace, String label) throws ApiException { - V1PodList listNamespacedPod = - COREV1_API.listNamespacedPod( - namespace, - null, - null, - null, - null, - label, - null, - null, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - List listPods = - listNamespacedPod.getItems().stream() - .map(v1pod -> v1pod.getMetadata().getName()) - .collect(Collectors.toList()); - return listPods; - } - - /** - * List all Services in default namespace - * - * @return - * @throws ApiException - */ - public static List getServices() throws ApiException { - V1ServiceList listNamespacedService = - COREV1_API.listNamespacedService( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - null, - TIME_OUT_VALUE, - Boolean.FALSE); - return listNamespacedService.getItems().stream() - .map(v1service -> v1service.getMetadata().getName()) - .collect(Collectors.toList()); - } - - /** - * Scale up/down the number of pod in Deployment - * - * @param deploymentName - * @param numberOfReplicas - * @throws ApiException - */ - public static void scaleDeployment(String deploymentName, int numberOfReplicas) - throws ApiException { - AppsV1Api appsV1Api = new AppsV1Api(); - appsV1Api.setApiClient(COREV1_API.getApiClient()); - V1DeploymentList listNamespacedDeployment = - appsV1Api.listNamespacedDeployment( - DEFAULT_NAME_SPACE, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - Boolean.FALSE); - - List appsV1DeploymentItems = listNamespacedDeployment.getItems(); - Optional findedDeployment = - appsV1DeploymentItems.stream() - .filter( - (V1Deployment deployment) -> - deployment.getMetadata().getName().equals(deploymentName)) - .findFirst(); - findedDeployment.ifPresent( - (V1Deployment deploy) -> { - try { - V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas); - V1Deployment newDeploy = deploy.spec(newSpec); - appsV1Api.replaceNamespacedDeployment( - deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null); - } catch (ApiException ex) { - LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex); - } - }); - } - - /** - * Print out the Log for specific Pods - * - * @param namespace - * @param podName - * @throws ApiException - */ - public static void printLog(String namespace, String podName) throws ApiException { - // https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#readNamespacedPodLog - String readNamespacedPodLog = - COREV1_API.readNamespacedPodLog( - podName, - namespace, - null, - Boolean.FALSE, - null, - Integer.MAX_VALUE, - null, - Boolean.FALSE, - Integer.MAX_VALUE, - null, - 40, - Boolean.FALSE); - System.out.println(readNamespacedPodLog); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java deleted file mode 100644 index 3357ac2f00..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/FluentExample.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.Arrays; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.FluentExample" - * - *

From inside $REPO_DIR/examples - */ -public class FluentExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .endContainer() - .endSpec() - .build(); - - api.createNamespacedPod("default", pod, null, null, null, null); - - V1Pod pod2 = - new V1Pod() - .metadata(new V1ObjectMeta().name("anotherpod")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("www").image("nginx")))); - - api.createNamespacedPod("default", pod2, null, null, null, null); - - V1PodList list = - api.listNamespacedPod( - "default", null, null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java deleted file mode 100644 index ddfb1243b8..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/GenericClientExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Container; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.openapi.models.V1PodSpec; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.util.Arrays; - -public class GenericClientExample { - - public static void main(String[] args) throws Exception { - - // The following codes demonstrates using generic client to manipulate pods - V1Pod pod = - new V1Pod() - .metadata(new V1ObjectMeta().name("foo").namespace("default")) - .spec( - new V1PodSpec() - .containers(Arrays.asList(new V1Container().name("c").image("test")))); - - ApiClient apiClient = ClientBuilder.standard().build(); - GenericKubernetesApi podClient = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - - V1Pod latestPod = podClient.create(pod).throwsApiException().getObject(); - System.out.println("Created!"); - - V1Pod patchedPod = - podClient - .patch( - "default", - "foo", - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - new V1Patch("{\"metadata\":{\"finalizers\":[\"example.io/foo\"]}}")) - .throwsApiException() - .getObject(); - System.out.println("Patched!"); - - V1Pod deletedPod = podClient.delete("default", "foo").throwsApiException().getObject(); - if (deletedPod != null) { - System.out.println( - "Received after-deletion status of the requested object, will be deleting in background!"); - } - System.out.println("Deleted!"); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java deleted file mode 100644 index 0d6134bb68..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import java.io.IOException; - -/** - * A simple example of how to use the Java API inside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InClusterClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class InClusterClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // loading the in-cluster config, including: - // 1. service-account CA - // 2. service-account bearer-token - // 3. service-account namespace - // 4. master endpoints(ip, port) from pre-set environment variables - ApiClient client = ClientBuilder.cluster().build(); - - // if you prefer not to refresh service account token, please use: - // ApiClient client = ClientBuilder.oldCluster().build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java deleted file mode 100644 index a82e81bfde..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/InformerExample.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.informer.ResourceEventHandler; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.CallGeneratorParams; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.InformerExample" - * - *

From inside $REPO_DIR/examples - */ -public class InformerExample { - public static void main(String[] args) throws Exception { - CoreV1Api coreV1Api = new CoreV1Api(); - ApiClient apiClient = coreV1Api.getApiClient(); - OkHttpClient httpClient = - apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - apiClient.setHttpClient(httpClient); - - SharedInformerFactory factory = new SharedInformerFactory(apiClient); - - // Node informer - SharedIndexInformer nodeInformer = - factory.sharedIndexInformerFor( - // **NOTE**: - // The following "CallGeneratorParams" lambda merely generates a stateless - // HTTPs requests, the effective apiClient is the one specified when constructing - // the informer-factory. - (CallGeneratorParams params) -> { - return coreV1Api.listNodeCall( - null, - null, - null, - null, - null, - null, - params.resourceVersion, - null, - null, - params.timeoutSeconds, - params.watch, - null); - }, - V1Node.class, - V1NodeList.class); - - nodeInformer.addEventHandler( - new ResourceEventHandler() { - @Override - public void onAdd(V1Node node) { - System.out.printf("%s node added!\n", node.getMetadata().getName()); - } - - @Override - public void onUpdate(V1Node oldNode, V1Node newNode) { - System.out.printf( - "%s => %s node updated!\n", - oldNode.getMetadata().getName(), newNode.getMetadata().getName()); - } - - @Override - public void onDelete(V1Node node, boolean deletedFinalStateUnknown) { - System.out.printf("%s node deleted!\n", node.getMetadata().getName()); - } - }); - - factory.startAllRegisteredInformers(); - - V1Node nodeToCreate = new V1Node(); - V1ObjectMeta metadata = new V1ObjectMeta(); - metadata.setName("noxu"); - nodeToCreate.setMetadata(metadata); - V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null); - Thread.sleep(3000); - - Lister nodeLister = new Lister(nodeInformer.getIndexer()); - V1Node node = nodeLister.get("noxu"); - System.out.printf("noxu created! %s\n", node.getMetadata().getCreationTimestamp()); - factory.stopAllRegisteredInformers(); - Thread.sleep(3000); - System.out.println("informer stopped.."); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java deleted file mode 100644 index 0aa8ae8e13..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.KubeConfig; -import java.io.FileReader; -import java.io.IOException; - -/** - * A simple example of how to use the Java API from an application outside a kubernetes cluster - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubeConfigFileClientExample" - * - *

From inside $REPO_DIR/examples - */ -public class KubeConfigFileClientExample { - public static void main(String[] args) throws IOException, ApiException { - - // file path to your KubeConfig - - String kubeConfigPath = System.getenv("HOME") + "/.kube/config"; - - // loading the out-of-cluster config, a kubeconfig from file-system - ApiClient client = - ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build(); - - // set the global default api-client to the in-cluster one from above - Configuration.setDefaultApiClient(client); - - // the CoreV1Api loads default api-client from global configuration. - CoreV1Api api = new CoreV1Api(); - - // invokes the CoreV1Api client - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); - for (V1Pod item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java deleted file mode 100644 index 2619c9f271..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/KubectlExample.java +++ /dev/null @@ -1,311 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static io.kubernetes.client.extended.kubectl.Kubectl.apiResources; -import static io.kubernetes.client.extended.kubectl.Kubectl.copy; -import static io.kubernetes.client.extended.kubectl.Kubectl.cordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.delete; -import static io.kubernetes.client.extended.kubectl.Kubectl.drain; -import static io.kubernetes.client.extended.kubectl.Kubectl.exec; -import static io.kubernetes.client.extended.kubectl.Kubectl.label; -import static io.kubernetes.client.extended.kubectl.Kubectl.log; -import static io.kubernetes.client.extended.kubectl.Kubectl.portforward; -import static io.kubernetes.client.extended.kubectl.Kubectl.scale; -import static io.kubernetes.client.extended.kubectl.Kubectl.taint; -import static io.kubernetes.client.extended.kubectl.Kubectl.top; -import static io.kubernetes.client.extended.kubectl.Kubectl.uncordon; -import static io.kubernetes.client.extended.kubectl.Kubectl.version; -import static io.kubernetes.client.extended.kubectl.KubectlTop.podMetricSum; - -import io.kubernetes.client.common.KubernetesObject; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.extended.kubectl.KubectlExec; -import io.kubernetes.client.extended.kubectl.KubectlPortForward; -import io.kubernetes.client.extended.kubectl.exception.KubectlException; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1ReplicationController; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.lang3.tuple.Pair; - -/** - * A Java equivalent for the kubectl command line tool. Not nearly as complete. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.KubectlExample" -Dexec.args="log some-pod" - * - *

From inside $REPO_DIR/examples - */ -public class KubectlExample { - static Class getClassForKind(String kind) { - switch (kind) { - case "pod": - case "pods": - return V1Pod.class; - case "deployment": - case "deployments": - return V1Deployment.class; - case "service": - case "services": - return V1Service.class; - case "node": - case "nodes": - return V1Node.class; - case "replicationcontroller": - case "replicationcontrollers": - return V1ReplicationController.class; - } - return null; - } - - private static final String PADDING = " "; - - private static String pad(String value) { - while (value.length() < PADDING.length()) { - value += " "; - } - return value; - } - - public static void main(String[] args) - throws java.io.IOException, KubectlException, ParseException { - ApiClient client = Config.defaultClient(); - - Options options = new Options(); - options.addOption(new Option("n", "namespace", true, "The namespace for the resource")); - options.addOption(new Option("r", "replicas", true, "The number of replicas to scale to")); - options.addOption(new Option("c", "container", true, "The container in a pod to connect to")); - DefaultParser parser = new DefaultParser(); - CommandLine cli = parser.parse(options, args); - - args = cli.getArgs(); - String verb = args[0]; - String ns = cli.getOptionValue("n", "default"); - String kind = null; - String name = null; - - switch (verb) { - case "delete": - kind = args[1]; - name = args[2]; - delete(getClassForKind(kind)).namespace(ns).name(name).execute(); - case "drain": - name = args[1]; - drain().apiClient(client).name(name).execute(); - System.out.println("Node drained"); - System.exit(0); - case "cordon": - name = args[1]; - cordon().apiClient(client).name(name).execute(); - System.out.println("Node cordoned"); - System.exit(0); - case "uncordon": - name = args[1]; - uncordon().apiClient(client).name(name).execute(); - System.out.println("Node uncordoned"); - System.exit(0); - case "top": - String what = args[1]; - switch (what) { - case "nodes": - case "node": - List> nodes = - top(V1Node.class, NodeMetrics.class).apiClient(client).metric("cpu").execute(); - System.out.println(pad("Node") + "\tCPU\t\tMemory"); - for (Pair node : nodes) { - System.out.println( - pad(node.getLeft().getMetadata().getName()) - + "\t" - + node.getRight().getUsage().get("cpu").getNumber() - + "\t" - + node.getRight().getUsage().get("memory").getNumber()); - } - System.exit(0); - case "pods": - case "pod": - List> pods = - top(V1Pod.class, PodMetrics.class) - .apiClient(client) - .namespace(ns) - .metric("cpu") - .execute(); - System.out.println(pad("Pod") + "\tCPU\t\tMemory"); - for (Pair pod : pods) { - System.out.println( - pad(pod.getLeft().getMetadata().getName()) - + "\t" - + podMetricSum(pod.getRight(), "cpu") - + "\t" - + podMetricSum(pod.getRight(), "memory")); - } - System.exit(0); - } - System.err.println("Unknown top argument: " + what); - System.exit(-1); - case "cp": - String from = args[1]; - String to = args[2]; - if (from.indexOf(":") != -1) { - String[] parts = from.split(":"); - name = parts[0]; - from = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .fromPod(from) - .to(to) - .execute(); - } else if (to.indexOf(":") != -1) { - String[] parts = to.split(":"); - name = parts[0]; - to = parts[1]; - copy() - .apiClient(client) - .namespace(ns) - .name(name) - .container(cli.getOptionValue("c", "")) - .from(from) - .toPod(to) - .execute(); - } else { - System.err.println("Missing pod name for copy."); - System.exit(-1); - } - System.out.println("Copied " + from + " -> " + to); - System.exit(0); - case "taint": - name = args[1]; - String taintSpec = args[2]; - boolean remove = taintSpec.endsWith("-"); - int ix = taintSpec.indexOf("="); - int ix2 = taintSpec.indexOf(":"); - - if (remove) { - taintSpec = taintSpec.substring(0, taintSpec.length() - 2); - String key = ix == -1 ? taintSpec : taintSpec.substring(0, ix); - String effect = ix == -1 ? null : taintSpec.substring(ix + 1); - - if (effect == null) { - taint().apiClient(client).name(name).removeTaint(key).execute(); - } else { - taint().apiClient(client).name(name).removeTaint(key, effect).execute(); - } - System.exit(0); - } - if (ix2 == -1) { - System.err.println("key:effect or key=value:effect is required."); - System.exit(-1); - } - String key = taintSpec.substring(0, ix == -1 ? ix2 : ix); - String value = ix == -1 ? null : taintSpec.substring(ix + 1, ix2); - String effect = taintSpec.substring(ix2 + 1); - - if (value == null) { - taint().apiClient(client).name(name).addTaint(key, effect).execute(); - } else { - taint().apiClient(client).name(name).addTaint(key, value, effect).execute(); - } - System.exit(0); - case "portforward": - name = args[1]; - KubectlPortForward forward = portforward().apiClient(client).name(name).namespace(ns); - for (int i = 2; i < args.length; i++) { - String port = args[i]; - String[] ports = port.split(":"); - System.out.println("Forwarding " + ns + "/" + name + " " + ports[0] + "->" + ports[1]); - forward.ports(Integer.parseInt(ports[0]), Integer.parseInt(ports[1])); - } - forward.execute(); - System.exit(0); - case "log": - name = args[1]; - Streams.copy( - log() - .apiClient(client) - .name(name) - .namespace(ns) - .container(cli.getOptionValue("c", "")) - .execute(), - System.out); - System.exit(0); - case "scale": - kind = args[1]; - name = args[2]; - if (!cli.hasOption("r")) { - System.err.println("--replicas is required"); - System.exit(-3); - } - int replicas = Integer.parseInt(cli.getOptionValue("r")); - scale(getClassForKind(kind)) - .apiClient(client) - .namespace(ns) - .name(name) - .replicas(replicas) - .execute(); - System.out.println("Deployment scaled."); - System.exit(0); - case "version": - System.out.println(version().apiClient(client)); - System.exit(0); - case "label": - kind = args[1]; - name = args[2]; - String labelKey = args[3]; - String labelValue = args[4]; - Class clazz = getClassForKind(kind); - if (clazz == null) { - System.err.println("Unknown kind: " + kind); - System.exit(-2); - } - label(clazz).apiClient(client).namespace(ns).name(name).addLabel(labelKey, labelValue); - System.exit(0); - case "exec": - name = args[1]; - String[] command = Arrays.copyOfRange(args, 2, args.length); - KubectlExec e = - exec() - .apiClient(client) - .namespace(ns) - .name(name) - .command(command) - .container(cli.getOptionValue("c", "")); - System.exit(e.execute()); - case "api-resources": - apiResources().apiClient(client).execute().stream() - .forEach( - r -> - System.out.printf( - "%s\t\t%s\t\t%s\t\t%s\n", - r.getResourcePlural(), r.getGroup(), r.getKind(), r.getNamespaced())); - System.exit(0); - default: - System.out.println("Unknown verb: " + verb); - System.exit(-1); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java deleted file mode 100644 index 0e48689602..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.leaderelection.LeaderElectionConfig; -import io.kubernetes.client.extended.leaderelection.LeaderElector; -import io.kubernetes.client.extended.leaderelection.resourcelock.EndpointsLock; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.time.Duration; -import java.util.UUID; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LeaderElectionExample" - * - *

From inside $REPO_DIR/examples - */ -public class LeaderElectionExample { - public static void main(String[] args) throws Exception { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // New - String appNamespace = "default"; - String appName = "leader-election-foobar"; - String lockHolderIdentityName = UUID.randomUUID().toString(); // Anything unique - EndpointsLock lock = new EndpointsLock(appNamespace, appName, lockHolderIdentityName); - - LeaderElectionConfig leaderElectionConfig = - new LeaderElectionConfig( - lock, Duration.ofMillis(10000), Duration.ofMillis(8000), Duration.ofMillis(2000)); - try (LeaderElector leaderElector = new LeaderElector(leaderElectionConfig)) { - leaderElector.run( - () -> { - System.out.println("Do something when getting leadership."); - }, - () -> { - System.out.println("Do something when losing leadership."); - }); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java deleted file mode 100644 index ec7d8cb44f..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/LogsExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PodLogs; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.io.InputStream; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.LogsExample" - * - *

From inside $REPO_DIR/examples - */ -public class LogsExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - CoreV1Api coreApi = new CoreV1Api(client); - - PodLogs logs = new PodLogs(); - V1Pod pod = - coreApi - .listNamespacedPod( - "default", "false", null, null, null, null, null, null, null, null, null, null) - .getItems() - .get(0); - - InputStream is = logs.streamNamespacedPodLog(pod); - Streams.copy(is, System.out); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java deleted file mode 100644 index 0d8c10e30b..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/MetricsExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.Metrics; -import io.kubernetes.client.custom.ContainerMetrics; -import io.kubernetes.client.custom.NodeMetrics; -import io.kubernetes.client.custom.NodeMetricsList; -import io.kubernetes.client.custom.PodMetrics; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.MetricsExample" - * - *

From inside $REPO_DIR/examples - */ -public class MetricsExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - Metrics metrics = new Metrics(client); - NodeMetricsList list = metrics.getNodeMetrics(); - for (NodeMetrics item : list.getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - for (String key : item.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + item.getUsage().get(key)); - } - System.out.println(); - } - - for (PodMetrics item : metrics.getPodMetrics("default").getItems()) { - System.out.println(item.getMetadata().getName()); - System.out.println("------------------------------"); - if (item.getContainers() == null) { - continue; - } - for (ContainerMetrics container : item.getContainers()) { - System.out.println(container.getName()); - System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - for (String key : container.getUsage().keySet()) { - System.out.println("\t" + key); - System.out.println("\t" + container.getUsage().get(key)); - } - System.out.println(); - } - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java deleted file mode 100644 index 3153775ab7..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PagerExample.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.pager.Pager; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1NamespaceList; -import io.kubernetes.client.util.Config; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PagerExample" - * - *

From inside $REPO_DIR/examples - */ -public class PagerExample { - public static void main(String[] args) throws IOException { - - ApiClient client = Config.defaultClient(); - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - CoreV1Api api = new CoreV1Api(); - int i = 0; - Pager pager = - new Pager( - (Pager.PagerParams param) -> { - try { - return api.listNamespaceCall( - null, - null, - param.getContinueToken(), - null, - null, - param.getLimit(), - null, - null, - null, - 1, - null, - null); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, - client, - 10, - V1NamespaceList.class); - for (V1Namespace namespace : pager) { - System.out.println(namespace.getMetadata().getName()); - } - System.out.println("------------------"); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java deleted file mode 100644 index 92866a46fe..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ParseExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ParseExample" - * - *

From inside $REPO_DIR/examples - */ -public class ParseExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - if (args.length < 2) { - System.err.println("Usage: ParseExample "); - System.exit(1); - } - ApiClient client = Config.defaultClient(); - FileReader json = new FileReader(args[0]); - Object obj = - client - .getJSON() - .getGson() - .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); - - String output = client.getJSON().getGson().toJson(obj); - - // Test round tripping... - Object obj2 = - client - .getJSON() - .getGson() - .fromJson( - new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); - - String output2 = client.getJSON().getGson().toJson(obj2); - - // Validate round trip - if (!output.equals(output2)) { - System.err.println("Error, expected:\n" + output + "\nto equal\n" + output2); - System.exit(2); - } - - System.out.println(output); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java deleted file mode 100644 index 7eed3360d3..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PatchExample.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.AppsV1Api; -import io.kubernetes.client.openapi.models.V1Deployment; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.PatchUtils; -import java.io.IOException; - -/** - * A simple Example of how to use the Java API.
- * This example demonstrates patching of deployment using Json Patch and Strategic Merge Patch.
- * For generating Json Patches, refer http://jsonpatch.com. For - * generating Strategic Merge Patches, refer strategic-merge-patch.md. - * - *

    - *
  • Creates deployment hello-node with terminationGracePeriodSeconds value as 30 and a - * finalizer. - *
  • Json-Patches deployment hello-node with terminationGracePeriodSeconds value as 27. - *
  • Strategic-Merge-Patches deployment hello-node removing the finalizer. - *
- * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PatchExample" - * - *

From inside $REPO_DIR/examples - */ -public class PatchExample { - static String jsonPatchStr = - "[{\"op\":\"replace\",\"path\":\"/spec/template/spec/terminationGracePeriodSeconds\",\"value\":27}]"; - static String strategicMergePatchStr = - "{\"metadata\":{\"$deleteFromPrimitiveList/finalizers\":[\"example.com/test\"]}}"; - static String jsonDeploymentStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v1\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - static String applyYamlStr = - "{\"kind\":\"Deployment\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"name\":\"hello-node\",\"finalizers\":[\"example.com/test\"],\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"run\":\"hello-node\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"run\":\"hello-node\"}},\"spec\":{\"terminationGracePeriodSeconds\":30,\"containers\":[{\"name\":\"hello-node\",\"image\":\"hello-node:v2\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{}}]}},\"strategy\":{}},\"status\":{}}"; - - public static void main(String[] args) throws IOException { - try { - AppsV1Api api = new AppsV1Api(ClientBuilder.standard().build()); - V1Deployment body = - Configuration.getDefaultApiClient() - .getJSON() - .deserialize(jsonDeploymentStr, V1Deployment.class); - - // create a deployment - V1Deployment deploy1 = - api.createNamespacedDeployment("default", body, null, null, null, null); - System.out.println("original deployment" + deploy1); - - // json-patch a deployment - V1Deployment deploy2 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(jsonPatchStr), - null, - null, - null, - null, // field-manager is optional - null, - null), - V1Patch.PATCH_FORMAT_JSON_PATCH, - api.getApiClient()); - System.out.println("json-patched deployment" + deploy2); - - // strategic-merge-patch a deployment - V1Deployment deploy3 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(strategicMergePatchStr), - null, - null, - null, // field-manager is optional - null, - null, - null), - V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH, - api.getApiClient()); - System.out.println("strategic-merge-patched deployment" + deploy3); - - // apply-yaml a deployment, server side apply is available by default after kubernetes v1.16 - // or opt-in by turning on the feature gate for v1.14 or v1.15. - // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply - V1Deployment deploy4 = - PatchUtils.patch( - V1Deployment.class, - () -> - api.patchNamespacedDeploymentCall( - "hello-node", - "default", - new V1Patch(applyYamlStr), - null, - null, - "example-field-manager", // field-manager is required for server-side apply - null, - true, - null), - V1Patch.PATCH_FORMAT_APPLY_YAML, - api.getApiClient()); - System.out.println("application/apply-patch+yaml deployment" + deploy4); - - } catch (ApiException e) { - System.out.println(e.getResponseBody()); - e.printStackTrace(); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java deleted file mode 100644 index cbe064db31..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PortForwardExample.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.PortForward; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Streams; -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.List; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PortForwardExample" from inside - * $REPO_DIR/examples - * - *

Then: curl localhost:8080 from a different terminal (but be quick about it, the socket times - * out pretty fast...) - */ -public class PortForwardExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - PortForward forward = new PortForward(); - List ports = new ArrayList<>(); - int localPort = 8080; - int targetPort = 8080; - ports.add(targetPort); - final PortForward.PortForwardResult result = - forward.forward("default", "camera-viz-7949dbf7c6-lpxkd", ports); - System.out.println("Forwarding!"); - ServerSocket ss = new ServerSocket(localPort); - - final Socket s = ss.accept(); - System.out.println("Connected!"); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(result.getInputStream(targetPort), s.getOutputStream()); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - new Thread( - new Runnable() { - public void run() { - try { - Streams.copy(s.getInputStream(), result.getOutboundStream(targetPort)); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - }) - .start(); - - Thread.sleep(10 * 1000); - - System.exit(0); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java deleted file mode 100644 index 65f38b8ce4..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PromOpExample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.coreos.monitoring.models.V1Prometheus; -import com.coreos.monitoring.models.V1PrometheusList; -import com.coreos.monitoring.models.V1PrometheusSpec; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.util.ClientBuilder; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.io.IOException; - -public class PromOpExample { - public static void main(String[] args) throws IOException, ApiException { - GenericKubernetesApi prometheusApi = - new GenericKubernetesApi<>( - V1Prometheus.class, - V1PrometheusList.class, - "monitoring.coreos.com", - "v1", - "prometheuses", - ClientBuilder.defaultClient()); - prometheusApi - .create( - new V1Prometheus() - .metadata(new V1ObjectMeta().namespace("default").name("my-prometheus")) - .kind("Prometheus") - .apiVersion("monitoring.coreos.com/v1") - .spec(new V1PrometheusSpec())) - .throwsApiException(); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java deleted file mode 100644 index e3c6c9daaf..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/PrometheusExample.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.monitoring.Monitoring; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API with Prometheus metrics - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.PrometheusExample" - * - *

From inside $REPO_DIR/examples - */ -public class PrometheusExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // Install an HTTP Interceptor that adds metrics - Monitoring.installMetrics(client); - - // Install a simple HTTP server to serve prometheus metrics. If you already are serving - // metrics elsewhere, this is unnecessary. - Monitoring.startMetricsServer("localhost", 8080); - - CoreV1Api api = new CoreV1Api(); - - while (true) { - // A request that should return 200 - V1PodList list = - api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); - // A request that should return 404 - try { - V1Pod pod = api.readNamespacedPod("foo", "bar", null); - } catch (ApiException ex) { - if (ex.getCode() != 404) { - throw ex; - } - } - try { - Thread.sleep(10000); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java deleted file mode 100644 index e4e05a2aa1..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/ProtoExample.java +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.ProtoClient; -import io.kubernetes.client.ProtoClient.ObjectOrStatus; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.proto.Meta.ObjectMeta; -import io.kubernetes.client.proto.V1.Namespace; -import io.kubernetes.client.proto.V1.NamespaceSpec; -import io.kubernetes.client.proto.V1.Pod; -import io.kubernetes.client.proto.V1.PodList; -import io.kubernetes.client.util.Config; -import java.io.IOException; - -/** - * A simple example of how to use the Java API - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.ProtoExample" - * - *

From inside $REPO_DIR/examples - */ -public class ProtoExample { - public static void main(String[] args) throws IOException, ApiException, InterruptedException { - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - ProtoClient pc = new ProtoClient(client); - ObjectOrStatus list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods"); - - if (list.object.getItemsCount() > 0) { - Pod p = list.object.getItems(0); - System.out.println(p); - } - - Namespace namespace = - Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build(); - - ObjectOrStatus ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace"); - System.out.println(ns); - if (ns.object != null) { - namespace = - ns.object - .toBuilder() - .setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()) - .build(); - // This is how you would update an object, but you can't actually - // update namespaces, so this returns a 405 - ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace"); - System.out.println(ns.status); - } - - ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test"); - System.out.println(ns); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java deleted file mode 100644 index f6494a836e..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringControllerExample.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.controller.Controller; -import io.kubernetes.client.extended.controller.builder.ControllerBuilder; -import io.kubernetes.client.extended.controller.builder.DefaultControllerBuilder; -import io.kubernetes.client.extended.controller.reconciler.Reconciler; -import io.kubernetes.client.extended.controller.reconciler.Request; -import io.kubernetes.client.extended.controller.reconciler.Result; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.openapi.models.V1EndpointsList; -import io.kubernetes.client.openapi.models.V1Node; -import io.kubernetes.client.openapi.models.V1NodeList; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodList; -import io.kubernetes.client.util.generic.GenericKubernetesApi; -import java.time.Duration; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; - -@SpringBootApplication -public class SpringControllerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringControllerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner commandLineRunner( - SharedInformerFactory sharedInformerFactory, Controller nodePrintingController) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("running controller.."); - nodePrintingController.run(); - }; - } - - @Bean - public Controller nodePrintingController( - SharedInformerFactory sharedInformerFactory, NodePrintingReconciler reconciler) { - DefaultControllerBuilder builder = ControllerBuilder.defaultBuilder(sharedInformerFactory); - builder = - builder.watch( - (q) -> { - return ControllerBuilder.controllerWatchBuilder(V1Node.class, q) - .withResyncPeriod(Duration.ofMinutes(1)) - .build(); - }); - builder.withWorkerCount(2); - builder.withReadyFunc(reconciler::informerReady); - return builder.withReconciler(reconciler).withName("nodePrintingController").build(); - } - - @Bean - public SharedIndexInformer endpointsInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>( - V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Endpoints.class, 0); - } - - @Bean - public SharedIndexInformer nodeInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Node.class, V1NodeList.class, "", "v1", "nodes", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Node.class, 60 * 1000L); - } - - @Bean - public SharedIndexInformer podInformer( - ApiClient apiClient, SharedInformerFactory sharedInformerFactory) { - GenericKubernetesApi genericApi = - new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", apiClient); - return sharedInformerFactory.sharedIndexInformerFor(genericApi, V1Pod.class, 0); - } - } - - @Component - public static class NodePrintingReconciler implements Reconciler { - - @Value("${namespace}") - private String namespace; - - private SharedInformer nodeInformer; - - private SharedInformer podInformer; - - private Lister nodeLister; - - private Lister podLister; - - public NodePrintingReconciler( - SharedIndexInformer nodeInformer, SharedIndexInformer podInformer) { - this.nodeInformer = nodeInformer; - this.podInformer = podInformer; - this.nodeLister = new Lister<>(nodeInformer.getIndexer(), namespace); - this.podLister = new Lister<>(podInformer.getIndexer(), namespace); - } - - // *OPTIONAL* - // If you want to hold the controller from running util some condition.. - public boolean informerReady() { - return podInformer.hasSynced() && nodeInformer.hasSynced(); - } - - @Override - public Result reconcile(Request request) { - V1Node node = nodeLister.get(request.getName()); - - System.out.println("get all pods in namespace " + namespace); - podLister.namespace(namespace).list().stream() - .map(pod -> pod.getMetadata().getName()) - .forEach(System.out::println); - - System.out.println("triggered reconciling " + node.getMetadata().getName()); - return new Result(false); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java deleted file mode 100644 index bafe11e421..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/SpringLoadBalancerExample.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.extended.network.EndpointsLoadBalancer; -import io.kubernetes.client.extended.network.LoadBalancer; -import io.kubernetes.client.extended.network.RoundRobinLoadBalanceStrategy; -import io.kubernetes.client.informer.SharedIndexInformer; -import io.kubernetes.client.informer.SharedInformerFactory; -import io.kubernetes.client.informer.cache.Lister; -import io.kubernetes.client.openapi.models.V1Endpoints; -import io.kubernetes.client.spring.extended.network.endpoints.InformerEndpointsGetter; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@SpringBootApplication -public class SpringLoadBalancerExample { - - public static void main(String[] args) { - SpringApplication.run(SpringLoadBalancerExample.class, args); - } - - @Configuration - public static class AppConfig { - - @Bean - public CommandLineRunner loadBalancerCommandLineRunner( - SharedInformerFactory sharedInformerFactory, MyService myService) { - return args -> { - System.out.println("starting informers.."); - sharedInformerFactory.startAllRegisteredInformers(); - - System.out.println("routing default/kubernetes:"); - System.out.println(myService.defaultKubernetesLoadBalancer.getTargetIP()); - }; - } - - @Bean - public MyService myService(SharedIndexInformer lister) { - return new MyService(new Lister<>(lister.getIndexer())); - } - } - - public static class MyService { - - private LoadBalancer defaultKubernetesLoadBalancer; - - public MyService(Lister lister) { - InformerEndpointsGetter getter = new InformerEndpointsGetter(lister); - RoundRobinLoadBalanceStrategy strategy = new RoundRobinLoadBalanceStrategy(); - defaultKubernetesLoadBalancer = - new EndpointsLoadBalancer(() -> getter.get("default", "kubernetes"), strategy); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java deleted file mode 100644 index 786f84f7bd..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WatchExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import com.google.gson.reflect.TypeToken; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Watch; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import okhttp3.OkHttpClient; - -/** A simple example of how to use Watch API to watch changes in Namespace list. */ -public class WatchExample { - public static void main(String[] args) throws IOException, ApiException { - ApiClient client = Config.defaultClient(); - // infinite timeout - OkHttpClient httpClient = - client.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build(); - client.setHttpClient(httpClient); - Configuration.setDefaultApiClient(client); - - CoreV1Api api = new CoreV1Api(); - - Watch watch = - Watch.createWatch( - client, - api.listNamespaceCall( - null, null, null, null, null, null, null, null, null, null, Boolean.TRUE, null), - new TypeToken>() {}.getType()); - - try { - for (Watch.Response item : watch) { - System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName()); - } - } finally { - watch.close(); - } - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java deleted file mode 100644 index e1f54dcd07..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/WebSocketsExample.java +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.WebSockets; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import okhttp3.WebSocket; - -/** - * This is a pretty low level, most people won't need to use WebSockets directly. - * - *

If you do need to run it, you can run: mvn exec:java \ - * -Dexec.mainClass=io.kubernetes.client.examples.WebSocketsExample \ - * -Dexec.args=/api/v1/namespaces/default/pods//attach?stdout=true - * - *

Note that you'd think 'watch' calls were WebSockets, but you'd be wrong, they're straight HTTP - * GET calls. - */ -public class WebSocketsExample { - public static void main(String... args) throws ApiException, IOException { - final ApiClient client = Config.defaultClient(); - WebSockets.stream( - args[0], - "GET", - client, - new WebSockets.SocketListener() { - private volatile WebSocket socket; - - @Override - public void open(String protocol, WebSocket socket) { - this.socket = socket; - } - - @Override - public void close() {} - - @Override - public void bytesMessage(InputStream is) {} - - @Override - public void failure(Throwable t) { - t.printStackTrace(); - } - - @Override - public void textMessage(Reader in) { - try { - BufferedReader reader = new BufferedReader(in); - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - System.out.println(line); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - }); - } -} diff --git a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java b/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java deleted file mode 100644 index 9e12aa6f84..0000000000 --- a/examples/examples-release-19/src/main/java/io/kubernetes/client/examples/YamlExample.java +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import io.kubernetes.client.custom.IntOrString; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.openapi.models.V1Pod; -import io.kubernetes.client.openapi.models.V1PodBuilder; -import io.kubernetes.client.openapi.models.V1Service; -import io.kubernetes.client.openapi.models.V1ServiceBuilder; -import io.kubernetes.client.util.Config; -import io.kubernetes.client.util.Yaml; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; - -/** - * A simple example of how to parse a Kubernetes object. - * - *

Easiest way to run this: mvn exec:java - * -Dexec.mainClass="io.kubernetes.client.examples.YamlExample" - * - *

From inside $REPO_DIR/examples - */ -public class YamlExample { - public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException { - V1Pod pod = - new V1PodBuilder() - .withNewMetadata() - .withName("apod") - .endMetadata() - .withNewSpec() - .addNewContainer() - .withName("www") - .withImage("nginx") - .withNewResources() - .withLimits(new HashMap<>()) - .endResources() - .endContainer() - .endSpec() - .build(); - System.out.println(Yaml.dump(pod)); - - V1Service svc = - new V1ServiceBuilder() - .withNewMetadata() - .withName("aservice") - .endMetadata() - .withNewSpec() - .withSessionAffinity("ClientIP") - .withType("NodePort") - .addNewPort() - .withProtocol("TCP") - .withName("client") - .withPort(8008) - .withNodePort(8080) - .withTargetPort(new IntOrString(8080)) - .endPort() - .endSpec() - .build(); - System.out.println(Yaml.dump(svc)); - - // Read yaml configuration file, and deploy it - ApiClient client = Config.defaultClient(); - Configuration.setDefaultApiClient(client); - - // See issue #474. Not needed at most cases, but it is needed if you are using war - // packging or running this on JUnit. - Yaml.addModelMap("v1", "Service", V1Service.class); - - // Example yaml file can be found in $REPO_DIR/test-svc.yaml - File file = new File("test-svc.yaml"); - V1Service yamlSvc = (V1Service) Yaml.load(file); - - // Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of - // CoreV1API - CoreV1Api api = new CoreV1Api(); - V1Service createResult = - api.createNamespacedService("default", yamlSvc, null, null, null, null); - - System.out.println(createResult); - - V1Service deleteResult = - api.deleteNamespacedService( - yamlSvc.getMetadata().getName(), - "default", - null, - null, - null, - null, - null, - null, - new V1DeleteOptions()); - System.out.println(deleteResult); - } -} diff --git a/examples/examples-release-19/src/main/resources/application.properties b/examples/examples-release-19/src/main/resources/application.properties deleted file mode 100644 index dc886e5f48..0000000000 --- a/examples/examples-release-19/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -namespace=airflow -management.endpoints.web.exposure.include=prometheus \ No newline at end of file diff --git a/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java b/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java deleted file mode 100644 index df2f168e41..0000000000 --- a/examples/examples-release-19/src/test/java/io/kubernetes/client/examples/ExampleTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.examples; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertEquals; - -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.apis.CoreV1Api; -import io.kubernetes.client.openapi.models.V1Namespace; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import java.io.IOException; -import org.junit.Rule; -import org.junit.Test; - -public class ExampleTest { - private static final int PORT = 8089; - @Rule public WireMockRule wireMockRule = new WireMockRule(PORT); - - @Test - public void exactUrlOnly() throws IOException, ApiException { - ApiClient client = new ApiClient(); - client.setBasePath("http://localhost:" + PORT); - Configuration.setDefaultApiClient(client); - - V1Namespace ns1 = new V1Namespace().metadata(new V1ObjectMeta().name("name")); - - stubFor( - get(urlEqualTo("/api/v1/namespaces/name")) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBody(client.getJSON().serialize(ns1)))); - - CoreV1Api api = new CoreV1Api(); - V1Namespace ns2 = api.readNamespace("name", null); - assertEquals(ns1, ns2); - } -} diff --git a/examples/examples-release-19/test-svc.yaml b/examples/examples-release-19/test-svc.yaml deleted file mode 100644 index f225bea76f..0000000000 --- a/examples/examples-release-19/test-svc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: test-service -spec: - type: ClusterIP - selector: - app: test-service - ports: - - name: port-of-container - port: 8080 \ No newline at end of file diff --git a/examples/examples-release-19/test.yaml b/examples/examples-release-19/test.yaml deleted file mode 100644 index 0b46e57003..0000000000 --- a/examples/examples-release-19/test.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: test -spec: - replicas: 1 - template: - metadata: - labels: - app: test - spec: - containers: - - name: test - image: test/examples:1.0 - command: ["/bin/sh","-c"] - args: ["java -jar /examples.jar","while :; do sleep 1; done"] diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java deleted file mode 100644 index eeb1c72b63..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1GroupVersionResourceBuilder extends V1alpha1GroupVersionResourceFluent implements VisitableBuilder{ - public V1alpha1GroupVersionResourceBuilder() { - this(new V1alpha1GroupVersionResource()); - } - - public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResourceFluent fluent) { - this(fluent, new V1alpha1GroupVersionResource()); - } - - public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResourceFluent fluent,V1alpha1GroupVersionResource instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1GroupVersionResourceBuilder(V1alpha1GroupVersionResource instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1GroupVersionResourceFluent fluent; - - public V1alpha1GroupVersionResource build() { - V1alpha1GroupVersionResource buildable = new V1alpha1GroupVersionResource(); - buildable.setGroup(fluent.getGroup()); - buildable.setResource(fluent.getResource()); - buildable.setVersion(fluent.getVersion()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java deleted file mode 100644 index d92ea2a9cf..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResourceFluent.java +++ /dev/null @@ -1,122 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; -import java.lang.String; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1GroupVersionResourceFluent> extends BaseFluent{ - public V1alpha1GroupVersionResourceFluent() { - } - - public V1alpha1GroupVersionResourceFluent(V1alpha1GroupVersionResource instance) { - this.copyInstance(instance); - } - private String group; - private String resource; - private String version; - - protected void copyInstance(V1alpha1GroupVersionResource instance) { - instance = instance != null ? instance : new V1alpha1GroupVersionResource(); - if (instance != null) { - this.withGroup(instance.getGroup()); - this.withResource(instance.getResource()); - this.withVersion(instance.getVersion()); - } - } - - public String getGroup() { - return this.group; - } - - public A withGroup(String group) { - this.group = group; - return (A) this; - } - - public boolean hasGroup() { - return this.group != null; - } - - public String getResource() { - return this.resource; - } - - public A withResource(String resource) { - this.resource = resource; - return (A) this; - } - - public boolean hasResource() { - return this.resource != null; - } - - public String getVersion() { - return this.version; - } - - public A withVersion(String version) { - this.version = version; - return (A) this; - } - - public boolean hasVersion() { - return this.version != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1GroupVersionResourceFluent that = (V1alpha1GroupVersionResourceFluent) o; - if (!(Objects.equals(group, that.group))) { - return false; - } - if (!(Objects.equals(resource, that.resource))) { - return false; - } - if (!(Objects.equals(version, that.version))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(group, resource, version); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(group == null)) { - sb.append("group:"); - sb.append(group); - sb.append(","); - } - if (!(resource == null)) { - sb.append("resource:"); - sb.append(resource); - sb.append(","); - } - if (!(version == null)) { - sb.append("version:"); - sb.append(version); - } - sb.append("}"); - return sb.toString(); - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java deleted file mode 100644 index 5bb338525d..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1MigrationConditionBuilder extends V1alpha1MigrationConditionFluent implements VisitableBuilder{ - public V1alpha1MigrationConditionBuilder() { - this(new V1alpha1MigrationCondition()); - } - - public V1alpha1MigrationConditionBuilder(V1alpha1MigrationConditionFluent fluent) { - this(fluent, new V1alpha1MigrationCondition()); - } - - public V1alpha1MigrationConditionBuilder(V1alpha1MigrationConditionFluent fluent,V1alpha1MigrationCondition instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1MigrationConditionBuilder(V1alpha1MigrationCondition instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1MigrationConditionFluent fluent; - - public V1alpha1MigrationCondition build() { - V1alpha1MigrationCondition buildable = new V1alpha1MigrationCondition(); - buildable.setLastUpdateTime(fluent.getLastUpdateTime()); - buildable.setMessage(fluent.getMessage()); - buildable.setReason(fluent.getReason()); - buildable.setStatus(fluent.getStatus()); - buildable.setType(fluent.getType()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java deleted file mode 100644 index 719d813778..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationConditionFluent.java +++ /dev/null @@ -1,169 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.time.OffsetDateTime; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; -import java.lang.String; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1MigrationConditionFluent> extends BaseFluent{ - public V1alpha1MigrationConditionFluent() { - } - - public V1alpha1MigrationConditionFluent(V1alpha1MigrationCondition instance) { - this.copyInstance(instance); - } - private OffsetDateTime lastUpdateTime; - private String message; - private String reason; - private String status; - private String type; - - protected void copyInstance(V1alpha1MigrationCondition instance) { - instance = instance != null ? instance : new V1alpha1MigrationCondition(); - if (instance != null) { - this.withLastUpdateTime(instance.getLastUpdateTime()); - this.withMessage(instance.getMessage()); - this.withReason(instance.getReason()); - this.withStatus(instance.getStatus()); - this.withType(instance.getType()); - } - } - - public OffsetDateTime getLastUpdateTime() { - return this.lastUpdateTime; - } - - public A withLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - return (A) this; - } - - public boolean hasLastUpdateTime() { - return this.lastUpdateTime != null; - } - - public String getMessage() { - return this.message; - } - - public A withMessage(String message) { - this.message = message; - return (A) this; - } - - public boolean hasMessage() { - return this.message != null; - } - - public String getReason() { - return this.reason; - } - - public A withReason(String reason) { - this.reason = reason; - return (A) this; - } - - public boolean hasReason() { - return this.reason != null; - } - - public String getStatus() { - return this.status; - } - - public A withStatus(String status) { - this.status = status; - return (A) this; - } - - public boolean hasStatus() { - return this.status != null; - } - - public String getType() { - return this.type; - } - - public A withType(String type) { - this.type = type; - return (A) this; - } - - public boolean hasType() { - return this.type != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1MigrationConditionFluent that = (V1alpha1MigrationConditionFluent) o; - if (!(Objects.equals(lastUpdateTime, that.lastUpdateTime))) { - return false; - } - if (!(Objects.equals(message, that.message))) { - return false; - } - if (!(Objects.equals(reason, that.reason))) { - return false; - } - if (!(Objects.equals(status, that.status))) { - return false; - } - if (!(Objects.equals(type, that.type))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(lastUpdateTime, message, reason, status, type); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(lastUpdateTime == null)) { - sb.append("lastUpdateTime:"); - sb.append(lastUpdateTime); - sb.append(","); - } - if (!(message == null)) { - sb.append("message:"); - sb.append(message); - sb.append(","); - } - if (!(reason == null)) { - sb.append("reason:"); - sb.append(reason); - sb.append(","); - } - if (!(status == null)) { - sb.append("status:"); - sb.append(status); - sb.append(","); - } - if (!(type == null)) { - sb.append("type:"); - sb.append(type); - } - sb.append("}"); - return sb.toString(); - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java deleted file mode 100644 index b6b4d0cd79..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1PodCertificateRequestBuilder extends V1alpha1PodCertificateRequestFluent implements VisitableBuilder{ - public V1alpha1PodCertificateRequestBuilder() { - this(new V1alpha1PodCertificateRequest()); - } - - public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequestFluent fluent) { - this(fluent, new V1alpha1PodCertificateRequest()); - } - - public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequestFluent fluent,V1alpha1PodCertificateRequest instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1PodCertificateRequestBuilder(V1alpha1PodCertificateRequest instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1PodCertificateRequestFluent fluent; - - public V1alpha1PodCertificateRequest build() { - V1alpha1PodCertificateRequest buildable = new V1alpha1PodCertificateRequest(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - buildable.setSpec(fluent.buildSpec()); - buildable.setStatus(fluent.buildStatus()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java deleted file mode 100644 index 7b1a6acb3b..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestFluent.java +++ /dev/null @@ -1,298 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.lang.String; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Optional; -import java.util.Objects; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1PodCertificateRequestFluent> extends BaseFluent{ - public V1alpha1PodCertificateRequestFluent() { - } - - public V1alpha1PodCertificateRequestFluent(V1alpha1PodCertificateRequest instance) { - this.copyInstance(instance); - } - private String apiVersion; - private String kind; - private V1ObjectMetaBuilder metadata; - private V1alpha1PodCertificateRequestSpecBuilder spec; - private V1alpha1PodCertificateRequestStatusBuilder status; - - protected void copyInstance(V1alpha1PodCertificateRequest instance) { - instance = instance != null ? instance : new V1alpha1PodCertificateRequest(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - this.withSpec(instance.getSpec()); - this.withStatus(instance.getStatus()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ObjectMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ObjectMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ObjectMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ObjectMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public V1alpha1PodCertificateRequestSpec buildSpec() { - return this.spec != null ? this.spec.build() : null; - } - - public A withSpec(V1alpha1PodCertificateRequestSpec spec) { - this._visitables.remove("spec"); - if (spec != null) { - this.spec = new V1alpha1PodCertificateRequestSpecBuilder(spec); - this._visitables.get("spec").add(this.spec); - } else { - this.spec = null; - this._visitables.get("spec").remove(this.spec); - } - return (A) this; - } - - public boolean hasSpec() { - return this.spec != null; - } - - public SpecNested withNewSpec() { - return new SpecNested(null); - } - - public SpecNested withNewSpecLike(V1alpha1PodCertificateRequestSpec item) { - return new SpecNested(item); - } - - public SpecNested editSpec() { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(null)); - } - - public SpecNested editOrNewSpec() { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(new V1alpha1PodCertificateRequestSpecBuilder().build())); - } - - public SpecNested editOrNewSpecLike(V1alpha1PodCertificateRequestSpec item) { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(item)); - } - - public V1alpha1PodCertificateRequestStatus buildStatus() { - return this.status != null ? this.status.build() : null; - } - - public A withStatus(V1alpha1PodCertificateRequestStatus status) { - this._visitables.remove("status"); - if (status != null) { - this.status = new V1alpha1PodCertificateRequestStatusBuilder(status); - this._visitables.get("status").add(this.status); - } else { - this.status = null; - this._visitables.get("status").remove(this.status); - } - return (A) this; - } - - public boolean hasStatus() { - return this.status != null; - } - - public StatusNested withNewStatus() { - return new StatusNested(null); - } - - public StatusNested withNewStatusLike(V1alpha1PodCertificateRequestStatus item) { - return new StatusNested(item); - } - - public StatusNested editStatus() { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(null)); - } - - public StatusNested editOrNewStatus() { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(new V1alpha1PodCertificateRequestStatusBuilder().build())); - } - - public StatusNested editOrNewStatusLike(V1alpha1PodCertificateRequestStatus item) { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1PodCertificateRequestFluent that = (V1alpha1PodCertificateRequestFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - if (!(Objects.equals(spec, that.spec))) { - return false; - } - if (!(Objects.equals(status, that.status))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - sb.append(","); - } - if (!(spec == null)) { - sb.append("spec:"); - sb.append(spec); - sb.append(","); - } - if (!(status == null)) { - sb.append("status:"); - sb.append(status); - } - sb.append("}"); - return sb.toString(); - } - public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ - MetadataNested(V1ObjectMeta item) { - this.builder = new V1ObjectMetaBuilder(this, item); - } - V1ObjectMetaBuilder builder; - - public N and() { - return (N) V1alpha1PodCertificateRequestFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - public class SpecNested extends V1alpha1PodCertificateRequestSpecFluent> implements Nested{ - SpecNested(V1alpha1PodCertificateRequestSpec item) { - this.builder = new V1alpha1PodCertificateRequestSpecBuilder(this, item); - } - V1alpha1PodCertificateRequestSpecBuilder builder; - - public N and() { - return (N) V1alpha1PodCertificateRequestFluent.this.withSpec(builder.build()); - } - - public N endSpec() { - return and(); - } - - - } - public class StatusNested extends V1alpha1PodCertificateRequestStatusFluent> implements Nested{ - StatusNested(V1alpha1PodCertificateRequestStatus item) { - this.builder = new V1alpha1PodCertificateRequestStatusBuilder(this, item); - } - V1alpha1PodCertificateRequestStatusBuilder builder; - - public N and() { - return (N) V1alpha1PodCertificateRequestFluent.this.withStatus(builder.build()); - } - - public N endStatus() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java deleted file mode 100644 index aeaa911eff..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1PodCertificateRequestListBuilder extends V1alpha1PodCertificateRequestListFluent implements VisitableBuilder{ - public V1alpha1PodCertificateRequestListBuilder() { - this(new V1alpha1PodCertificateRequestList()); - } - - public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestListFluent fluent) { - this(fluent, new V1alpha1PodCertificateRequestList()); - } - - public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestListFluent fluent,V1alpha1PodCertificateRequestList instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1PodCertificateRequestListBuilder(V1alpha1PodCertificateRequestList instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1PodCertificateRequestListFluent fluent; - - public V1alpha1PodCertificateRequestList build() { - V1alpha1PodCertificateRequestList buildable = new V1alpha1PodCertificateRequestList(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setItems(fluent.buildItems()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java deleted file mode 100644 index 06a25ab817..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestListFluent.java +++ /dev/null @@ -1,408 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.util.ArrayList; -import java.lang.String; -import java.util.function.Predicate; -import java.lang.RuntimeException; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1PodCertificateRequestListFluent> extends BaseFluent{ - public V1alpha1PodCertificateRequestListFluent() { - } - - public V1alpha1PodCertificateRequestListFluent(V1alpha1PodCertificateRequestList instance) { - this.copyInstance(instance); - } - private String apiVersion; - private ArrayList items; - private String kind; - private V1ListMetaBuilder metadata; - - protected void copyInstance(V1alpha1PodCertificateRequestList instance) { - instance = instance != null ? instance : new V1alpha1PodCertificateRequestList(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withItems(instance.getItems()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public A addToItems(int index,V1alpha1PodCertificateRequest item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.add(index, builder); - } - return (A) this; - } - - public A setToItems(int index,V1alpha1PodCertificateRequest item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.set(index, builder); - } - return (A) this; - } - - public A addToItems(V1alpha1PodCertificateRequest... items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1PodCertificateRequest item : items) { - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A addAllToItems(Collection items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1PodCertificateRequest item : items) { - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A removeFromItems(V1alpha1PodCertificateRequest... items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1PodCertificateRequest item : items) { - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeAllFromItems(Collection items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1PodCertificateRequest item : items) { - V1alpha1PodCertificateRequestBuilder builder = new V1alpha1PodCertificateRequestBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeMatchingFromItems(Predicate predicate) { - if (items == null) { - return (A) this; - } - Iterator each = items.iterator(); - List visitables = _visitables.get("items"); - while (each.hasNext()) { - V1alpha1PodCertificateRequestBuilder builder = each.next(); - if (predicate.test(builder)) { - visitables.remove(builder); - each.remove(); - } - } - return (A) this; - } - - public List buildItems() { - return this.items != null ? build(items) : null; - } - - public V1alpha1PodCertificateRequest buildItem(int index) { - return this.items.get(index).build(); - } - - public V1alpha1PodCertificateRequest buildFirstItem() { - return this.items.get(0).build(); - } - - public V1alpha1PodCertificateRequest buildLastItem() { - return this.items.get(items.size() - 1).build(); - } - - public V1alpha1PodCertificateRequest buildMatchingItem(Predicate predicate) { - for (V1alpha1PodCertificateRequestBuilder item : items) { - if (predicate.test(item)) { - return item.build(); - } - } - return null; - } - - public boolean hasMatchingItem(Predicate predicate) { - for (V1alpha1PodCertificateRequestBuilder item : items) { - if (predicate.test(item)) { - return true; - } - } - return false; - } - - public A withItems(List items) { - if (this.items != null) { - this._visitables.get("items").clear(); - } - if (items != null) { - this.items = new ArrayList(); - for (V1alpha1PodCertificateRequest item : items) { - this.addToItems(item); - } - } else { - this.items = null; - } - return (A) this; - } - - public A withItems(V1alpha1PodCertificateRequest... items) { - if (this.items != null) { - this.items.clear(); - _visitables.remove("items"); - } - if (items != null) { - for (V1alpha1PodCertificateRequest item : items) { - this.addToItems(item); - } - } - return (A) this; - } - - public boolean hasItems() { - return this.items != null && !(this.items.isEmpty()); - } - - public ItemsNested addNewItem() { - return new ItemsNested(-1, null); - } - - public ItemsNested addNewItemLike(V1alpha1PodCertificateRequest item) { - return new ItemsNested(-1, item); - } - - public ItemsNested setNewItemLike(int index,V1alpha1PodCertificateRequest item) { - return new ItemsNested(index, item); - } - - public ItemsNested editItem(int index) { - if (index <= items.size()) { - throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editFirstItem() { - if (items.size() == 0) { - throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); - } - return this.setNewItemLike(0, this.buildItem(0)); - } - - public ItemsNested editLastItem() { - int index = items.size() - 1; - if (index < 0) { - throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editMatchingItem(Predicate predicate) { - int index = -1; - for (int i = 0;i < items.size();i++) { - if (predicate.test(items.get(i))) { - index = i; - break; - } - } - if (index < 0) { - throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ListMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ListMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ListMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ListMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ListMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1PodCertificateRequestListFluent that = (V1alpha1PodCertificateRequestListFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(items, that.items))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(items == null) && !(items.isEmpty())) { - sb.append("items:"); - sb.append(items); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - } - sb.append("}"); - return sb.toString(); - } - public class ItemsNested extends V1alpha1PodCertificateRequestFluent> implements Nested{ - ItemsNested(int index,V1alpha1PodCertificateRequest item) { - this.index = index; - this.builder = new V1alpha1PodCertificateRequestBuilder(this, item); - } - V1alpha1PodCertificateRequestBuilder builder; - int index; - - public N and() { - return (N) V1alpha1PodCertificateRequestListFluent.this.setToItems(index, builder.build()); - } - - public N endItem() { - return and(); - } - - - } - public class MetadataNested extends V1ListMetaFluent> implements Nested{ - MetadataNested(V1ListMeta item) { - this.builder = new V1ListMetaBuilder(this, item); - } - V1ListMetaBuilder builder; - - public N and() { - return (N) V1alpha1PodCertificateRequestListFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java deleted file mode 100644 index 80ad69b1cd..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1PodCertificateRequestSpecBuilder extends V1alpha1PodCertificateRequestSpecFluent implements VisitableBuilder{ - public V1alpha1PodCertificateRequestSpecBuilder() { - this(new V1alpha1PodCertificateRequestSpec()); - } - - public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpecFluent fluent) { - this(fluent, new V1alpha1PodCertificateRequestSpec()); - } - - public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpecFluent fluent,V1alpha1PodCertificateRequestSpec instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1PodCertificateRequestSpecBuilder(V1alpha1PodCertificateRequestSpec instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1PodCertificateRequestSpecFluent fluent; - - public V1alpha1PodCertificateRequestSpec build() { - V1alpha1PodCertificateRequestSpec buildable = new V1alpha1PodCertificateRequestSpec(); - buildable.setMaxExpirationSeconds(fluent.getMaxExpirationSeconds()); - buildable.setNodeName(fluent.getNodeName()); - buildable.setNodeUID(fluent.getNodeUID()); - buildable.setPkixPublicKey(fluent.getPkixPublicKey()); - buildable.setPodName(fluent.getPodName()); - buildable.setPodUID(fluent.getPodUID()); - buildable.setProofOfPossession(fluent.getProofOfPossession()); - buildable.setServiceAccountName(fluent.getServiceAccountName()); - buildable.setServiceAccountUID(fluent.getServiceAccountUID()); - buildable.setSignerName(fluent.getSignerName()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java deleted file mode 100644 index 62ec63bdd4..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpecFluent.java +++ /dev/null @@ -1,434 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import java.util.ArrayList; -import java.lang.String; -import java.lang.Integer; -import java.lang.Byte; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; -import java.util.List; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1PodCertificateRequestSpecFluent> extends BaseFluent{ - public V1alpha1PodCertificateRequestSpecFluent() { - } - - public V1alpha1PodCertificateRequestSpecFluent(V1alpha1PodCertificateRequestSpec instance) { - this.copyInstance(instance); - } - private Integer maxExpirationSeconds; - private String nodeName; - private String nodeUID; - private List pkixPublicKey; - private String podName; - private String podUID; - private List proofOfPossession; - private String serviceAccountName; - private String serviceAccountUID; - private String signerName; - - protected void copyInstance(V1alpha1PodCertificateRequestSpec instance) { - instance = instance != null ? instance : new V1alpha1PodCertificateRequestSpec(); - if (instance != null) { - this.withMaxExpirationSeconds(instance.getMaxExpirationSeconds()); - this.withNodeName(instance.getNodeName()); - this.withNodeUID(instance.getNodeUID()); - this.withPkixPublicKey(instance.getPkixPublicKey()); - this.withPodName(instance.getPodName()); - this.withPodUID(instance.getPodUID()); - this.withProofOfPossession(instance.getProofOfPossession()); - this.withServiceAccountName(instance.getServiceAccountName()); - this.withServiceAccountUID(instance.getServiceAccountUID()); - this.withSignerName(instance.getSignerName()); - } - } - - public Integer getMaxExpirationSeconds() { - return this.maxExpirationSeconds; - } - - public A withMaxExpirationSeconds(Integer maxExpirationSeconds) { - this.maxExpirationSeconds = maxExpirationSeconds; - return (A) this; - } - - public boolean hasMaxExpirationSeconds() { - return this.maxExpirationSeconds != null; - } - - public String getNodeName() { - return this.nodeName; - } - - public A withNodeName(String nodeName) { - this.nodeName = nodeName; - return (A) this; - } - - public boolean hasNodeName() { - return this.nodeName != null; - } - - public String getNodeUID() { - return this.nodeUID; - } - - public A withNodeUID(String nodeUID) { - this.nodeUID = nodeUID; - return (A) this; - } - - public boolean hasNodeUID() { - return this.nodeUID != null; - } - - public A withPkixPublicKey(byte... pkixPublicKey) { - if (this.pkixPublicKey != null) { - this.pkixPublicKey.clear(); - _visitables.remove("pkixPublicKey"); - } - if (pkixPublicKey != null) { - for (byte item : pkixPublicKey) { - this.addToPkixPublicKey(item); - } - } - return (A) this; - } - - public byte[] getPkixPublicKey() { - int size = pkixPublicKey != null ? pkixPublicKey.size() : 0; - byte[] result = new byte[size]; - if (size == 0) { - return result; - } - int index = 0; - for (byte item : pkixPublicKey) { - result[index++] = item; - } - return result; - } - - public A addToPkixPublicKey(int index,Byte item) { - if (this.pkixPublicKey == null) { - this.pkixPublicKey = new ArrayList(); - } - this.pkixPublicKey.add(index, item); - return (A) this; - } - - public A setToPkixPublicKey(int index,Byte item) { - if (this.pkixPublicKey == null) { - this.pkixPublicKey = new ArrayList(); - } - this.pkixPublicKey.set(index, item); - return (A) this; - } - - public A addToPkixPublicKey(Byte... items) { - if (this.pkixPublicKey == null) { - this.pkixPublicKey = new ArrayList(); - } - for (Byte item : items) { - this.pkixPublicKey.add(item); - } - return (A) this; - } - - public A addAllToPkixPublicKey(Collection items) { - if (this.pkixPublicKey == null) { - this.pkixPublicKey = new ArrayList(); - } - for (Byte item : items) { - this.pkixPublicKey.add(item); - } - return (A) this; - } - - public A removeFromPkixPublicKey(Byte... items) { - if (this.pkixPublicKey == null) { - return (A) this; - } - for (Byte item : items) { - this.pkixPublicKey.remove(item); - } - return (A) this; - } - - public A removeAllFromPkixPublicKey(Collection items) { - if (this.pkixPublicKey == null) { - return (A) this; - } - for (Byte item : items) { - this.pkixPublicKey.remove(item); - } - return (A) this; - } - - public boolean hasPkixPublicKey() { - return this.pkixPublicKey != null && !(this.pkixPublicKey.isEmpty()); - } - - public String getPodName() { - return this.podName; - } - - public A withPodName(String podName) { - this.podName = podName; - return (A) this; - } - - public boolean hasPodName() { - return this.podName != null; - } - - public String getPodUID() { - return this.podUID; - } - - public A withPodUID(String podUID) { - this.podUID = podUID; - return (A) this; - } - - public boolean hasPodUID() { - return this.podUID != null; - } - - public A withProofOfPossession(byte... proofOfPossession) { - if (this.proofOfPossession != null) { - this.proofOfPossession.clear(); - _visitables.remove("proofOfPossession"); - } - if (proofOfPossession != null) { - for (byte item : proofOfPossession) { - this.addToProofOfPossession(item); - } - } - return (A) this; - } - - public byte[] getProofOfPossession() { - int size = proofOfPossession != null ? proofOfPossession.size() : 0; - byte[] result = new byte[size]; - if (size == 0) { - return result; - } - int index = 0; - for (byte item : proofOfPossession) { - result[index++] = item; - } - return result; - } - - public A addToProofOfPossession(int index,Byte item) { - if (this.proofOfPossession == null) { - this.proofOfPossession = new ArrayList(); - } - this.proofOfPossession.add(index, item); - return (A) this; - } - - public A setToProofOfPossession(int index,Byte item) { - if (this.proofOfPossession == null) { - this.proofOfPossession = new ArrayList(); - } - this.proofOfPossession.set(index, item); - return (A) this; - } - - public A addToProofOfPossession(Byte... items) { - if (this.proofOfPossession == null) { - this.proofOfPossession = new ArrayList(); - } - for (Byte item : items) { - this.proofOfPossession.add(item); - } - return (A) this; - } - - public A addAllToProofOfPossession(Collection items) { - if (this.proofOfPossession == null) { - this.proofOfPossession = new ArrayList(); - } - for (Byte item : items) { - this.proofOfPossession.add(item); - } - return (A) this; - } - - public A removeFromProofOfPossession(Byte... items) { - if (this.proofOfPossession == null) { - return (A) this; - } - for (Byte item : items) { - this.proofOfPossession.remove(item); - } - return (A) this; - } - - public A removeAllFromProofOfPossession(Collection items) { - if (this.proofOfPossession == null) { - return (A) this; - } - for (Byte item : items) { - this.proofOfPossession.remove(item); - } - return (A) this; - } - - public boolean hasProofOfPossession() { - return this.proofOfPossession != null && !(this.proofOfPossession.isEmpty()); - } - - public String getServiceAccountName() { - return this.serviceAccountName; - } - - public A withServiceAccountName(String serviceAccountName) { - this.serviceAccountName = serviceAccountName; - return (A) this; - } - - public boolean hasServiceAccountName() { - return this.serviceAccountName != null; - } - - public String getServiceAccountUID() { - return this.serviceAccountUID; - } - - public A withServiceAccountUID(String serviceAccountUID) { - this.serviceAccountUID = serviceAccountUID; - return (A) this; - } - - public boolean hasServiceAccountUID() { - return this.serviceAccountUID != null; - } - - public String getSignerName() { - return this.signerName; - } - - public A withSignerName(String signerName) { - this.signerName = signerName; - return (A) this; - } - - public boolean hasSignerName() { - return this.signerName != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1PodCertificateRequestSpecFluent that = (V1alpha1PodCertificateRequestSpecFluent) o; - if (!(Objects.equals(maxExpirationSeconds, that.maxExpirationSeconds))) { - return false; - } - if (!(Objects.equals(nodeName, that.nodeName))) { - return false; - } - if (!(Objects.equals(nodeUID, that.nodeUID))) { - return false; - } - if (!(Objects.equals(pkixPublicKey, that.pkixPublicKey))) { - return false; - } - if (!(Objects.equals(podName, that.podName))) { - return false; - } - if (!(Objects.equals(podUID, that.podUID))) { - return false; - } - if (!(Objects.equals(proofOfPossession, that.proofOfPossession))) { - return false; - } - if (!(Objects.equals(serviceAccountName, that.serviceAccountName))) { - return false; - } - if (!(Objects.equals(serviceAccountUID, that.serviceAccountUID))) { - return false; - } - if (!(Objects.equals(signerName, that.signerName))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(maxExpirationSeconds, nodeName, nodeUID, pkixPublicKey, podName, podUID, proofOfPossession, serviceAccountName, serviceAccountUID, signerName); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(maxExpirationSeconds == null)) { - sb.append("maxExpirationSeconds:"); - sb.append(maxExpirationSeconds); - sb.append(","); - } - if (!(nodeName == null)) { - sb.append("nodeName:"); - sb.append(nodeName); - sb.append(","); - } - if (!(nodeUID == null)) { - sb.append("nodeUID:"); - sb.append(nodeUID); - sb.append(","); - } - if (!(pkixPublicKey == null) && !(pkixPublicKey.isEmpty())) { - sb.append("pkixPublicKey:"); - sb.append(pkixPublicKey); - sb.append(","); - } - if (!(podName == null)) { - sb.append("podName:"); - sb.append(podName); - sb.append(","); - } - if (!(podUID == null)) { - sb.append("podUID:"); - sb.append(podUID); - sb.append(","); - } - if (!(proofOfPossession == null) && !(proofOfPossession.isEmpty())) { - sb.append("proofOfPossession:"); - sb.append(proofOfPossession); - sb.append(","); - } - if (!(serviceAccountName == null)) { - sb.append("serviceAccountName:"); - sb.append(serviceAccountName); - sb.append(","); - } - if (!(serviceAccountUID == null)) { - sb.append("serviceAccountUID:"); - sb.append(serviceAccountUID); - sb.append(","); - } - if (!(signerName == null)) { - sb.append("signerName:"); - sb.append(signerName); - } - sb.append("}"); - return sb.toString(); - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java deleted file mode 100644 index 39668a7078..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1PodCertificateRequestStatusBuilder extends V1alpha1PodCertificateRequestStatusFluent implements VisitableBuilder{ - public V1alpha1PodCertificateRequestStatusBuilder() { - this(new V1alpha1PodCertificateRequestStatus()); - } - - public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatusFluent fluent) { - this(fluent, new V1alpha1PodCertificateRequestStatus()); - } - - public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatusFluent fluent,V1alpha1PodCertificateRequestStatus instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1PodCertificateRequestStatusBuilder(V1alpha1PodCertificateRequestStatus instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1PodCertificateRequestStatusFluent fluent; - - public V1alpha1PodCertificateRequestStatus build() { - V1alpha1PodCertificateRequestStatus buildable = new V1alpha1PodCertificateRequestStatus(); - buildable.setBeginRefreshAt(fluent.getBeginRefreshAt()); - buildable.setCertificateChain(fluent.getCertificateChain()); - buildable.setConditions(fluent.buildConditions()); - buildable.setNotAfter(fluent.getNotAfter()); - buildable.setNotBefore(fluent.getNotBefore()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java deleted file mode 100644 index 2dc94e78f8..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatusFluent.java +++ /dev/null @@ -1,388 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.util.ArrayList; -import java.lang.String; -import java.util.function.Predicate; -import java.lang.RuntimeException; -import java.time.OffsetDateTime; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Iterator; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; -import java.util.List; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1PodCertificateRequestStatusFluent> extends BaseFluent{ - public V1alpha1PodCertificateRequestStatusFluent() { - } - - public V1alpha1PodCertificateRequestStatusFluent(V1alpha1PodCertificateRequestStatus instance) { - this.copyInstance(instance); - } - private OffsetDateTime beginRefreshAt; - private String certificateChain; - private ArrayList conditions; - private OffsetDateTime notAfter; - private OffsetDateTime notBefore; - - protected void copyInstance(V1alpha1PodCertificateRequestStatus instance) { - instance = instance != null ? instance : new V1alpha1PodCertificateRequestStatus(); - if (instance != null) { - this.withBeginRefreshAt(instance.getBeginRefreshAt()); - this.withCertificateChain(instance.getCertificateChain()); - this.withConditions(instance.getConditions()); - this.withNotAfter(instance.getNotAfter()); - this.withNotBefore(instance.getNotBefore()); - } - } - - public OffsetDateTime getBeginRefreshAt() { - return this.beginRefreshAt; - } - - public A withBeginRefreshAt(OffsetDateTime beginRefreshAt) { - this.beginRefreshAt = beginRefreshAt; - return (A) this; - } - - public boolean hasBeginRefreshAt() { - return this.beginRefreshAt != null; - } - - public String getCertificateChain() { - return this.certificateChain; - } - - public A withCertificateChain(String certificateChain) { - this.certificateChain = certificateChain; - return (A) this; - } - - public boolean hasCertificateChain() { - return this.certificateChain != null; - } - - public A addToConditions(int index,V1Condition item) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - V1ConditionBuilder builder = new V1ConditionBuilder(item); - if (index < 0 || index >= conditions.size()) { - _visitables.get("conditions").add(builder); - conditions.add(builder); - } else { - _visitables.get("conditions").add(builder); - conditions.add(index, builder); - } - return (A) this; - } - - public A setToConditions(int index,V1Condition item) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - V1ConditionBuilder builder = new V1ConditionBuilder(item); - if (index < 0 || index >= conditions.size()) { - _visitables.get("conditions").add(builder); - conditions.add(builder); - } else { - _visitables.get("conditions").add(builder); - conditions.set(index, builder); - } - return (A) this; - } - - public A addToConditions(V1Condition... items) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - for (V1Condition item : items) { - V1ConditionBuilder builder = new V1ConditionBuilder(item); - _visitables.get("conditions").add(builder); - this.conditions.add(builder); - } - return (A) this; - } - - public A addAllToConditions(Collection items) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - for (V1Condition item : items) { - V1ConditionBuilder builder = new V1ConditionBuilder(item); - _visitables.get("conditions").add(builder); - this.conditions.add(builder); - } - return (A) this; - } - - public A removeFromConditions(V1Condition... items) { - if (this.conditions == null) { - return (A) this; - } - for (V1Condition item : items) { - V1ConditionBuilder builder = new V1ConditionBuilder(item); - _visitables.get("conditions").remove(builder); - this.conditions.remove(builder); - } - return (A) this; - } - - public A removeAllFromConditions(Collection items) { - if (this.conditions == null) { - return (A) this; - } - for (V1Condition item : items) { - V1ConditionBuilder builder = new V1ConditionBuilder(item); - _visitables.get("conditions").remove(builder); - this.conditions.remove(builder); - } - return (A) this; - } - - public A removeMatchingFromConditions(Predicate predicate) { - if (conditions == null) { - return (A) this; - } - Iterator each = conditions.iterator(); - List visitables = _visitables.get("conditions"); - while (each.hasNext()) { - V1ConditionBuilder builder = each.next(); - if (predicate.test(builder)) { - visitables.remove(builder); - each.remove(); - } - } - return (A) this; - } - - public List buildConditions() { - return this.conditions != null ? build(conditions) : null; - } - - public V1Condition buildCondition(int index) { - return this.conditions.get(index).build(); - } - - public V1Condition buildFirstCondition() { - return this.conditions.get(0).build(); - } - - public V1Condition buildLastCondition() { - return this.conditions.get(conditions.size() - 1).build(); - } - - public V1Condition buildMatchingCondition(Predicate predicate) { - for (V1ConditionBuilder item : conditions) { - if (predicate.test(item)) { - return item.build(); - } - } - return null; - } - - public boolean hasMatchingCondition(Predicate predicate) { - for (V1ConditionBuilder item : conditions) { - if (predicate.test(item)) { - return true; - } - } - return false; - } - - public A withConditions(List conditions) { - if (this.conditions != null) { - this._visitables.get("conditions").clear(); - } - if (conditions != null) { - this.conditions = new ArrayList(); - for (V1Condition item : conditions) { - this.addToConditions(item); - } - } else { - this.conditions = null; - } - return (A) this; - } - - public A withConditions(V1Condition... conditions) { - if (this.conditions != null) { - this.conditions.clear(); - _visitables.remove("conditions"); - } - if (conditions != null) { - for (V1Condition item : conditions) { - this.addToConditions(item); - } - } - return (A) this; - } - - public boolean hasConditions() { - return this.conditions != null && !(this.conditions.isEmpty()); - } - - public ConditionsNested addNewCondition() { - return new ConditionsNested(-1, null); - } - - public ConditionsNested addNewConditionLike(V1Condition item) { - return new ConditionsNested(-1, item); - } - - public ConditionsNested setNewConditionLike(int index,V1Condition item) { - return new ConditionsNested(index, item); - } - - public ConditionsNested editCondition(int index) { - if (index <= conditions.size()) { - throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public ConditionsNested editFirstCondition() { - if (conditions.size() == 0) { - throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "conditions")); - } - return this.setNewConditionLike(0, this.buildCondition(0)); - } - - public ConditionsNested editLastCondition() { - int index = conditions.size() - 1; - if (index < 0) { - throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public ConditionsNested editMatchingCondition(Predicate predicate) { - int index = -1; - for (int i = 0;i < conditions.size();i++) { - if (predicate.test(conditions.get(i))) { - index = i; - break; - } - } - if (index < 0) { - throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public OffsetDateTime getNotAfter() { - return this.notAfter; - } - - public A withNotAfter(OffsetDateTime notAfter) { - this.notAfter = notAfter; - return (A) this; - } - - public boolean hasNotAfter() { - return this.notAfter != null; - } - - public OffsetDateTime getNotBefore() { - return this.notBefore; - } - - public A withNotBefore(OffsetDateTime notBefore) { - this.notBefore = notBefore; - return (A) this; - } - - public boolean hasNotBefore() { - return this.notBefore != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1PodCertificateRequestStatusFluent that = (V1alpha1PodCertificateRequestStatusFluent) o; - if (!(Objects.equals(beginRefreshAt, that.beginRefreshAt))) { - return false; - } - if (!(Objects.equals(certificateChain, that.certificateChain))) { - return false; - } - if (!(Objects.equals(conditions, that.conditions))) { - return false; - } - if (!(Objects.equals(notAfter, that.notAfter))) { - return false; - } - if (!(Objects.equals(notBefore, that.notBefore))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(beginRefreshAt, certificateChain, conditions, notAfter, notBefore); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(beginRefreshAt == null)) { - sb.append("beginRefreshAt:"); - sb.append(beginRefreshAt); - sb.append(","); - } - if (!(certificateChain == null)) { - sb.append("certificateChain:"); - sb.append(certificateChain); - sb.append(","); - } - if (!(conditions == null) && !(conditions.isEmpty())) { - sb.append("conditions:"); - sb.append(conditions); - sb.append(","); - } - if (!(notAfter == null)) { - sb.append("notAfter:"); - sb.append(notAfter); - sb.append(","); - } - if (!(notBefore == null)) { - sb.append("notBefore:"); - sb.append(notBefore); - } - sb.append("}"); - return sb.toString(); - } - public class ConditionsNested extends V1ConditionFluent> implements Nested{ - ConditionsNested(int index,V1Condition item) { - this.index = index; - this.builder = new V1ConditionBuilder(this, item); - } - V1ConditionBuilder builder; - int index; - - public N and() { - return (N) V1alpha1PodCertificateRequestStatusFluent.this.setToConditions(index, builder.build()); - } - - public N endCondition() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java deleted file mode 100644 index 26c0cc4378..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1StorageVersionMigrationBuilder extends V1alpha1StorageVersionMigrationFluent implements VisitableBuilder{ - public V1alpha1StorageVersionMigrationBuilder() { - this(new V1alpha1StorageVersionMigration()); - } - - public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigrationFluent fluent) { - this(fluent, new V1alpha1StorageVersionMigration()); - } - - public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigrationFluent fluent,V1alpha1StorageVersionMigration instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1StorageVersionMigrationBuilder(V1alpha1StorageVersionMigration instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1StorageVersionMigrationFluent fluent; - - public V1alpha1StorageVersionMigration build() { - V1alpha1StorageVersionMigration buildable = new V1alpha1StorageVersionMigration(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - buildable.setSpec(fluent.buildSpec()); - buildable.setStatus(fluent.buildStatus()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java deleted file mode 100644 index 5d1d57cd22..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationFluent.java +++ /dev/null @@ -1,298 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.lang.String; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Optional; -import java.util.Objects; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1StorageVersionMigrationFluent> extends BaseFluent{ - public V1alpha1StorageVersionMigrationFluent() { - } - - public V1alpha1StorageVersionMigrationFluent(V1alpha1StorageVersionMigration instance) { - this.copyInstance(instance); - } - private String apiVersion; - private String kind; - private V1ObjectMetaBuilder metadata; - private V1alpha1StorageVersionMigrationSpecBuilder spec; - private V1alpha1StorageVersionMigrationStatusBuilder status; - - protected void copyInstance(V1alpha1StorageVersionMigration instance) { - instance = instance != null ? instance : new V1alpha1StorageVersionMigration(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - this.withSpec(instance.getSpec()); - this.withStatus(instance.getStatus()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ObjectMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ObjectMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ObjectMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ObjectMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public V1alpha1StorageVersionMigrationSpec buildSpec() { - return this.spec != null ? this.spec.build() : null; - } - - public A withSpec(V1alpha1StorageVersionMigrationSpec spec) { - this._visitables.remove("spec"); - if (spec != null) { - this.spec = new V1alpha1StorageVersionMigrationSpecBuilder(spec); - this._visitables.get("spec").add(this.spec); - } else { - this.spec = null; - this._visitables.get("spec").remove(this.spec); - } - return (A) this; - } - - public boolean hasSpec() { - return this.spec != null; - } - - public SpecNested withNewSpec() { - return new SpecNested(null); - } - - public SpecNested withNewSpecLike(V1alpha1StorageVersionMigrationSpec item) { - return new SpecNested(item); - } - - public SpecNested editSpec() { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(null)); - } - - public SpecNested editOrNewSpec() { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(new V1alpha1StorageVersionMigrationSpecBuilder().build())); - } - - public SpecNested editOrNewSpecLike(V1alpha1StorageVersionMigrationSpec item) { - return this.withNewSpecLike(Optional.ofNullable(this.buildSpec()).orElse(item)); - } - - public V1alpha1StorageVersionMigrationStatus buildStatus() { - return this.status != null ? this.status.build() : null; - } - - public A withStatus(V1alpha1StorageVersionMigrationStatus status) { - this._visitables.remove("status"); - if (status != null) { - this.status = new V1alpha1StorageVersionMigrationStatusBuilder(status); - this._visitables.get("status").add(this.status); - } else { - this.status = null; - this._visitables.get("status").remove(this.status); - } - return (A) this; - } - - public boolean hasStatus() { - return this.status != null; - } - - public StatusNested withNewStatus() { - return new StatusNested(null); - } - - public StatusNested withNewStatusLike(V1alpha1StorageVersionMigrationStatus item) { - return new StatusNested(item); - } - - public StatusNested editStatus() { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(null)); - } - - public StatusNested editOrNewStatus() { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(new V1alpha1StorageVersionMigrationStatusBuilder().build())); - } - - public StatusNested editOrNewStatusLike(V1alpha1StorageVersionMigrationStatus item) { - return this.withNewStatusLike(Optional.ofNullable(this.buildStatus()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1StorageVersionMigrationFluent that = (V1alpha1StorageVersionMigrationFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - if (!(Objects.equals(spec, that.spec))) { - return false; - } - if (!(Objects.equals(status, that.status))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - sb.append(","); - } - if (!(spec == null)) { - sb.append("spec:"); - sb.append(spec); - sb.append(","); - } - if (!(status == null)) { - sb.append("status:"); - sb.append(status); - } - sb.append("}"); - return sb.toString(); - } - public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ - MetadataNested(V1ObjectMeta item) { - this.builder = new V1ObjectMetaBuilder(this, item); - } - V1ObjectMetaBuilder builder; - - public N and() { - return (N) V1alpha1StorageVersionMigrationFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - public class SpecNested extends V1alpha1StorageVersionMigrationSpecFluent> implements Nested{ - SpecNested(V1alpha1StorageVersionMigrationSpec item) { - this.builder = new V1alpha1StorageVersionMigrationSpecBuilder(this, item); - } - V1alpha1StorageVersionMigrationSpecBuilder builder; - - public N and() { - return (N) V1alpha1StorageVersionMigrationFluent.this.withSpec(builder.build()); - } - - public N endSpec() { - return and(); - } - - - } - public class StatusNested extends V1alpha1StorageVersionMigrationStatusFluent> implements Nested{ - StatusNested(V1alpha1StorageVersionMigrationStatus item) { - this.builder = new V1alpha1StorageVersionMigrationStatusBuilder(this, item); - } - V1alpha1StorageVersionMigrationStatusBuilder builder; - - public N and() { - return (N) V1alpha1StorageVersionMigrationFluent.this.withStatus(builder.build()); - } - - public N endStatus() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java deleted file mode 100644 index cd49a8f5c9..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1StorageVersionMigrationListBuilder extends V1alpha1StorageVersionMigrationListFluent implements VisitableBuilder{ - public V1alpha1StorageVersionMigrationListBuilder() { - this(new V1alpha1StorageVersionMigrationList()); - } - - public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationListFluent fluent) { - this(fluent, new V1alpha1StorageVersionMigrationList()); - } - - public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationListFluent fluent,V1alpha1StorageVersionMigrationList instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1StorageVersionMigrationListBuilder(V1alpha1StorageVersionMigrationList instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1StorageVersionMigrationListFluent fluent; - - public V1alpha1StorageVersionMigrationList build() { - V1alpha1StorageVersionMigrationList buildable = new V1alpha1StorageVersionMigrationList(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setItems(fluent.buildItems()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java deleted file mode 100644 index 98a7c18d38..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationListFluent.java +++ /dev/null @@ -1,408 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.util.ArrayList; -import java.lang.String; -import java.util.function.Predicate; -import java.lang.RuntimeException; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1StorageVersionMigrationListFluent> extends BaseFluent{ - public V1alpha1StorageVersionMigrationListFluent() { - } - - public V1alpha1StorageVersionMigrationListFluent(V1alpha1StorageVersionMigrationList instance) { - this.copyInstance(instance); - } - private String apiVersion; - private ArrayList items; - private String kind; - private V1ListMetaBuilder metadata; - - protected void copyInstance(V1alpha1StorageVersionMigrationList instance) { - instance = instance != null ? instance : new V1alpha1StorageVersionMigrationList(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withItems(instance.getItems()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public A addToItems(int index,V1alpha1StorageVersionMigration item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.add(index, builder); - } - return (A) this; - } - - public A setToItems(int index,V1alpha1StorageVersionMigration item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.set(index, builder); - } - return (A) this; - } - - public A addToItems(V1alpha1StorageVersionMigration... items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1StorageVersionMigration item : items) { - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A addAllToItems(Collection items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1StorageVersionMigration item : items) { - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A removeFromItems(V1alpha1StorageVersionMigration... items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1StorageVersionMigration item : items) { - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeAllFromItems(Collection items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1StorageVersionMigration item : items) { - V1alpha1StorageVersionMigrationBuilder builder = new V1alpha1StorageVersionMigrationBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeMatchingFromItems(Predicate predicate) { - if (items == null) { - return (A) this; - } - Iterator each = items.iterator(); - List visitables = _visitables.get("items"); - while (each.hasNext()) { - V1alpha1StorageVersionMigrationBuilder builder = each.next(); - if (predicate.test(builder)) { - visitables.remove(builder); - each.remove(); - } - } - return (A) this; - } - - public List buildItems() { - return this.items != null ? build(items) : null; - } - - public V1alpha1StorageVersionMigration buildItem(int index) { - return this.items.get(index).build(); - } - - public V1alpha1StorageVersionMigration buildFirstItem() { - return this.items.get(0).build(); - } - - public V1alpha1StorageVersionMigration buildLastItem() { - return this.items.get(items.size() - 1).build(); - } - - public V1alpha1StorageVersionMigration buildMatchingItem(Predicate predicate) { - for (V1alpha1StorageVersionMigrationBuilder item : items) { - if (predicate.test(item)) { - return item.build(); - } - } - return null; - } - - public boolean hasMatchingItem(Predicate predicate) { - for (V1alpha1StorageVersionMigrationBuilder item : items) { - if (predicate.test(item)) { - return true; - } - } - return false; - } - - public A withItems(List items) { - if (this.items != null) { - this._visitables.get("items").clear(); - } - if (items != null) { - this.items = new ArrayList(); - for (V1alpha1StorageVersionMigration item : items) { - this.addToItems(item); - } - } else { - this.items = null; - } - return (A) this; - } - - public A withItems(V1alpha1StorageVersionMigration... items) { - if (this.items != null) { - this.items.clear(); - _visitables.remove("items"); - } - if (items != null) { - for (V1alpha1StorageVersionMigration item : items) { - this.addToItems(item); - } - } - return (A) this; - } - - public boolean hasItems() { - return this.items != null && !(this.items.isEmpty()); - } - - public ItemsNested addNewItem() { - return new ItemsNested(-1, null); - } - - public ItemsNested addNewItemLike(V1alpha1StorageVersionMigration item) { - return new ItemsNested(-1, item); - } - - public ItemsNested setNewItemLike(int index,V1alpha1StorageVersionMigration item) { - return new ItemsNested(index, item); - } - - public ItemsNested editItem(int index) { - if (index <= items.size()) { - throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editFirstItem() { - if (items.size() == 0) { - throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); - } - return this.setNewItemLike(0, this.buildItem(0)); - } - - public ItemsNested editLastItem() { - int index = items.size() - 1; - if (index < 0) { - throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editMatchingItem(Predicate predicate) { - int index = -1; - for (int i = 0;i < items.size();i++) { - if (predicate.test(items.get(i))) { - index = i; - break; - } - } - if (index < 0) { - throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ListMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ListMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ListMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ListMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ListMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1StorageVersionMigrationListFluent that = (V1alpha1StorageVersionMigrationListFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(items, that.items))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(items == null) && !(items.isEmpty())) { - sb.append("items:"); - sb.append(items); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - } - sb.append("}"); - return sb.toString(); - } - public class ItemsNested extends V1alpha1StorageVersionMigrationFluent> implements Nested{ - ItemsNested(int index,V1alpha1StorageVersionMigration item) { - this.index = index; - this.builder = new V1alpha1StorageVersionMigrationBuilder(this, item); - } - V1alpha1StorageVersionMigrationBuilder builder; - int index; - - public N and() { - return (N) V1alpha1StorageVersionMigrationListFluent.this.setToItems(index, builder.build()); - } - - public N endItem() { - return and(); - } - - - } - public class MetadataNested extends V1ListMetaFluent> implements Nested{ - MetadataNested(V1ListMeta item) { - this.builder = new V1ListMetaBuilder(this, item); - } - V1ListMetaBuilder builder; - - public N and() { - return (N) V1alpha1StorageVersionMigrationListFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java deleted file mode 100644 index 6457c13388..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1StorageVersionMigrationSpecBuilder extends V1alpha1StorageVersionMigrationSpecFluent implements VisitableBuilder{ - public V1alpha1StorageVersionMigrationSpecBuilder() { - this(new V1alpha1StorageVersionMigrationSpec()); - } - - public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpecFluent fluent) { - this(fluent, new V1alpha1StorageVersionMigrationSpec()); - } - - public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpecFluent fluent,V1alpha1StorageVersionMigrationSpec instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1StorageVersionMigrationSpecBuilder(V1alpha1StorageVersionMigrationSpec instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1StorageVersionMigrationSpecFluent fluent; - - public V1alpha1StorageVersionMigrationSpec build() { - V1alpha1StorageVersionMigrationSpec buildable = new V1alpha1StorageVersionMigrationSpec(); - buildable.setContinueToken(fluent.getContinueToken()); - buildable.setResource(fluent.buildResource()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java deleted file mode 100644 index 8c1b2e9a10..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpecFluent.java +++ /dev/null @@ -1,143 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.util.Optional; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.lang.String; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1StorageVersionMigrationSpecFluent> extends BaseFluent{ - public V1alpha1StorageVersionMigrationSpecFluent() { - } - - public V1alpha1StorageVersionMigrationSpecFluent(V1alpha1StorageVersionMigrationSpec instance) { - this.copyInstance(instance); - } - private String continueToken; - private V1alpha1GroupVersionResourceBuilder resource; - - protected void copyInstance(V1alpha1StorageVersionMigrationSpec instance) { - instance = instance != null ? instance : new V1alpha1StorageVersionMigrationSpec(); - if (instance != null) { - this.withContinueToken(instance.getContinueToken()); - this.withResource(instance.getResource()); - } - } - - public String getContinueToken() { - return this.continueToken; - } - - public A withContinueToken(String continueToken) { - this.continueToken = continueToken; - return (A) this; - } - - public boolean hasContinueToken() { - return this.continueToken != null; - } - - public V1alpha1GroupVersionResource buildResource() { - return this.resource != null ? this.resource.build() : null; - } - - public A withResource(V1alpha1GroupVersionResource resource) { - this._visitables.remove("resource"); - if (resource != null) { - this.resource = new V1alpha1GroupVersionResourceBuilder(resource); - this._visitables.get("resource").add(this.resource); - } else { - this.resource = null; - this._visitables.get("resource").remove(this.resource); - } - return (A) this; - } - - public boolean hasResource() { - return this.resource != null; - } - - public ResourceNested withNewResource() { - return new ResourceNested(null); - } - - public ResourceNested withNewResourceLike(V1alpha1GroupVersionResource item) { - return new ResourceNested(item); - } - - public ResourceNested editResource() { - return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(null)); - } - - public ResourceNested editOrNewResource() { - return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(new V1alpha1GroupVersionResourceBuilder().build())); - } - - public ResourceNested editOrNewResourceLike(V1alpha1GroupVersionResource item) { - return this.withNewResourceLike(Optional.ofNullable(this.buildResource()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1StorageVersionMigrationSpecFluent that = (V1alpha1StorageVersionMigrationSpecFluent) o; - if (!(Objects.equals(continueToken, that.continueToken))) { - return false; - } - if (!(Objects.equals(resource, that.resource))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(continueToken, resource); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(continueToken == null)) { - sb.append("continueToken:"); - sb.append(continueToken); - sb.append(","); - } - if (!(resource == null)) { - sb.append("resource:"); - sb.append(resource); - } - sb.append("}"); - return sb.toString(); - } - public class ResourceNested extends V1alpha1GroupVersionResourceFluent> implements Nested{ - ResourceNested(V1alpha1GroupVersionResource item) { - this.builder = new V1alpha1GroupVersionResourceBuilder(this, item); - } - V1alpha1GroupVersionResourceBuilder builder; - - public N and() { - return (N) V1alpha1StorageVersionMigrationSpecFluent.this.withResource(builder.build()); - } - - public N endResource() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java deleted file mode 100644 index 82041b8ef8..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1StorageVersionMigrationStatusBuilder extends V1alpha1StorageVersionMigrationStatusFluent implements VisitableBuilder{ - public V1alpha1StorageVersionMigrationStatusBuilder() { - this(new V1alpha1StorageVersionMigrationStatus()); - } - - public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatusFluent fluent) { - this(fluent, new V1alpha1StorageVersionMigrationStatus()); - } - - public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatusFluent fluent,V1alpha1StorageVersionMigrationStatus instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1StorageVersionMigrationStatusBuilder(V1alpha1StorageVersionMigrationStatus instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1StorageVersionMigrationStatusFluent fluent; - - public V1alpha1StorageVersionMigrationStatus build() { - V1alpha1StorageVersionMigrationStatus buildable = new V1alpha1StorageVersionMigrationStatus(); - buildable.setConditions(fluent.buildConditions()); - buildable.setResourceVersion(fluent.getResourceVersion()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java deleted file mode 100644 index 71c112a813..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatusFluent.java +++ /dev/null @@ -1,318 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.util.ArrayList; -import java.lang.String; -import java.util.function.Predicate; -import java.lang.RuntimeException; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Iterator; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; -import java.util.List; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1StorageVersionMigrationStatusFluent> extends BaseFluent{ - public V1alpha1StorageVersionMigrationStatusFluent() { - } - - public V1alpha1StorageVersionMigrationStatusFluent(V1alpha1StorageVersionMigrationStatus instance) { - this.copyInstance(instance); - } - private ArrayList conditions; - private String resourceVersion; - - protected void copyInstance(V1alpha1StorageVersionMigrationStatus instance) { - instance = instance != null ? instance : new V1alpha1StorageVersionMigrationStatus(); - if (instance != null) { - this.withConditions(instance.getConditions()); - this.withResourceVersion(instance.getResourceVersion()); - } - } - - public A addToConditions(int index,V1alpha1MigrationCondition item) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - if (index < 0 || index >= conditions.size()) { - _visitables.get("conditions").add(builder); - conditions.add(builder); - } else { - _visitables.get("conditions").add(builder); - conditions.add(index, builder); - } - return (A) this; - } - - public A setToConditions(int index,V1alpha1MigrationCondition item) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - if (index < 0 || index >= conditions.size()) { - _visitables.get("conditions").add(builder); - conditions.add(builder); - } else { - _visitables.get("conditions").add(builder); - conditions.set(index, builder); - } - return (A) this; - } - - public A addToConditions(V1alpha1MigrationCondition... items) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - for (V1alpha1MigrationCondition item : items) { - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - _visitables.get("conditions").add(builder); - this.conditions.add(builder); - } - return (A) this; - } - - public A addAllToConditions(Collection items) { - if (this.conditions == null) { - this.conditions = new ArrayList(); - } - for (V1alpha1MigrationCondition item : items) { - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - _visitables.get("conditions").add(builder); - this.conditions.add(builder); - } - return (A) this; - } - - public A removeFromConditions(V1alpha1MigrationCondition... items) { - if (this.conditions == null) { - return (A) this; - } - for (V1alpha1MigrationCondition item : items) { - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - _visitables.get("conditions").remove(builder); - this.conditions.remove(builder); - } - return (A) this; - } - - public A removeAllFromConditions(Collection items) { - if (this.conditions == null) { - return (A) this; - } - for (V1alpha1MigrationCondition item : items) { - V1alpha1MigrationConditionBuilder builder = new V1alpha1MigrationConditionBuilder(item); - _visitables.get("conditions").remove(builder); - this.conditions.remove(builder); - } - return (A) this; - } - - public A removeMatchingFromConditions(Predicate predicate) { - if (conditions == null) { - return (A) this; - } - Iterator each = conditions.iterator(); - List visitables = _visitables.get("conditions"); - while (each.hasNext()) { - V1alpha1MigrationConditionBuilder builder = each.next(); - if (predicate.test(builder)) { - visitables.remove(builder); - each.remove(); - } - } - return (A) this; - } - - public List buildConditions() { - return this.conditions != null ? build(conditions) : null; - } - - public V1alpha1MigrationCondition buildCondition(int index) { - return this.conditions.get(index).build(); - } - - public V1alpha1MigrationCondition buildFirstCondition() { - return this.conditions.get(0).build(); - } - - public V1alpha1MigrationCondition buildLastCondition() { - return this.conditions.get(conditions.size() - 1).build(); - } - - public V1alpha1MigrationCondition buildMatchingCondition(Predicate predicate) { - for (V1alpha1MigrationConditionBuilder item : conditions) { - if (predicate.test(item)) { - return item.build(); - } - } - return null; - } - - public boolean hasMatchingCondition(Predicate predicate) { - for (V1alpha1MigrationConditionBuilder item : conditions) { - if (predicate.test(item)) { - return true; - } - } - return false; - } - - public A withConditions(List conditions) { - if (this.conditions != null) { - this._visitables.get("conditions").clear(); - } - if (conditions != null) { - this.conditions = new ArrayList(); - for (V1alpha1MigrationCondition item : conditions) { - this.addToConditions(item); - } - } else { - this.conditions = null; - } - return (A) this; - } - - public A withConditions(V1alpha1MigrationCondition... conditions) { - if (this.conditions != null) { - this.conditions.clear(); - _visitables.remove("conditions"); - } - if (conditions != null) { - for (V1alpha1MigrationCondition item : conditions) { - this.addToConditions(item); - } - } - return (A) this; - } - - public boolean hasConditions() { - return this.conditions != null && !(this.conditions.isEmpty()); - } - - public ConditionsNested addNewCondition() { - return new ConditionsNested(-1, null); - } - - public ConditionsNested addNewConditionLike(V1alpha1MigrationCondition item) { - return new ConditionsNested(-1, item); - } - - public ConditionsNested setNewConditionLike(int index,V1alpha1MigrationCondition item) { - return new ConditionsNested(index, item); - } - - public ConditionsNested editCondition(int index) { - if (index <= conditions.size()) { - throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public ConditionsNested editFirstCondition() { - if (conditions.size() == 0) { - throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "conditions")); - } - return this.setNewConditionLike(0, this.buildCondition(0)); - } - - public ConditionsNested editLastCondition() { - int index = conditions.size() - 1; - if (index < 0) { - throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public ConditionsNested editMatchingCondition(Predicate predicate) { - int index = -1; - for (int i = 0;i < conditions.size();i++) { - if (predicate.test(conditions.get(i))) { - index = i; - break; - } - } - if (index < 0) { - throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "conditions")); - } - return this.setNewConditionLike(index, this.buildCondition(index)); - } - - public String getResourceVersion() { - return this.resourceVersion; - } - - public A withResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - return (A) this; - } - - public boolean hasResourceVersion() { - return this.resourceVersion != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1StorageVersionMigrationStatusFluent that = (V1alpha1StorageVersionMigrationStatusFluent) o; - if (!(Objects.equals(conditions, that.conditions))) { - return false; - } - if (!(Objects.equals(resourceVersion, that.resourceVersion))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(conditions, resourceVersion); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(conditions == null) && !(conditions.isEmpty())) { - sb.append("conditions:"); - sb.append(conditions); - sb.append(","); - } - if (!(resourceVersion == null)) { - sb.append("resourceVersion:"); - sb.append(resourceVersion); - } - sb.append("}"); - return sb.toString(); - } - public class ConditionsNested extends V1alpha1MigrationConditionFluent> implements Nested{ - ConditionsNested(int index,V1alpha1MigrationCondition item) { - this.index = index; - this.builder = new V1alpha1MigrationConditionBuilder(this, item); - } - V1alpha1MigrationConditionBuilder builder; - int index; - - public N and() { - return (N) V1alpha1StorageVersionMigrationStatusFluent.this.setToConditions(index, builder.build()); - } - - public N endCondition() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java deleted file mode 100644 index b3617fbaa0..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1VolumeAttributesClassBuilder extends V1alpha1VolumeAttributesClassFluent implements VisitableBuilder{ - public V1alpha1VolumeAttributesClassBuilder() { - this(new V1alpha1VolumeAttributesClass()); - } - - public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClassFluent fluent) { - this(fluent, new V1alpha1VolumeAttributesClass()); - } - - public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClassFluent fluent,V1alpha1VolumeAttributesClass instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1VolumeAttributesClassBuilder(V1alpha1VolumeAttributesClass instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1VolumeAttributesClassFluent fluent; - - public V1alpha1VolumeAttributesClass build() { - V1alpha1VolumeAttributesClass buildable = new V1alpha1VolumeAttributesClass(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setDriverName(fluent.getDriverName()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - buildable.setParameters(fluent.getParameters()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java deleted file mode 100644 index 23d2c67163..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassFluent.java +++ /dev/null @@ -1,262 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.util.Optional; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.lang.String; -import java.util.LinkedHashMap; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; -import java.util.Map; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1VolumeAttributesClassFluent> extends BaseFluent{ - public V1alpha1VolumeAttributesClassFluent() { - } - - public V1alpha1VolumeAttributesClassFluent(V1alpha1VolumeAttributesClass instance) { - this.copyInstance(instance); - } - private String apiVersion; - private String driverName; - private String kind; - private V1ObjectMetaBuilder metadata; - private Map parameters; - - protected void copyInstance(V1alpha1VolumeAttributesClass instance) { - instance = instance != null ? instance : new V1alpha1VolumeAttributesClass(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withDriverName(instance.getDriverName()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - this.withParameters(instance.getParameters()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public String getDriverName() { - return this.driverName; - } - - public A withDriverName(String driverName) { - this.driverName = driverName; - return (A) this; - } - - public boolean hasDriverName() { - return this.driverName != null; - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ObjectMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ObjectMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ObjectMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ObjectMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ObjectMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ObjectMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public A addToParameters(String key,String value) { - if (this.parameters == null && key != null && value != null) { - this.parameters = new LinkedHashMap(); - } - if (key != null && value != null) { - this.parameters.put(key, value); - } - return (A) this; - } - - public A addToParameters(Map map) { - if (this.parameters == null && map != null) { - this.parameters = new LinkedHashMap(); - } - if (map != null) { - this.parameters.putAll(map); - } - return (A) this; - } - - public A removeFromParameters(String key) { - if (this.parameters == null) { - return (A) this; - } - if (key != null && this.parameters != null) { - this.parameters.remove(key); - } - return (A) this; - } - - public A removeFromParameters(Map map) { - if (this.parameters == null) { - return (A) this; - } - if (map != null) { - for (Object key : map.keySet()) { - if (this.parameters != null) { - this.parameters.remove(key); - } - } - } - return (A) this; - } - - public Map getParameters() { - return this.parameters; - } - - public A withParameters(Map parameters) { - if (parameters == null) { - this.parameters = null; - } else { - this.parameters = new LinkedHashMap(parameters); - } - return (A) this; - } - - public boolean hasParameters() { - return this.parameters != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1VolumeAttributesClassFluent that = (V1alpha1VolumeAttributesClassFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(driverName, that.driverName))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - if (!(Objects.equals(parameters, that.parameters))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, driverName, kind, metadata, parameters); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(driverName == null)) { - sb.append("driverName:"); - sb.append(driverName); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - sb.append(","); - } - if (!(parameters == null) && !(parameters.isEmpty())) { - sb.append("parameters:"); - sb.append(parameters); - } - sb.append("}"); - return sb.toString(); - } - public class MetadataNested extends V1ObjectMetaFluent> implements Nested{ - MetadataNested(V1ObjectMeta item) { - this.builder = new V1ObjectMetaBuilder(this, item); - } - V1ObjectMetaBuilder builder; - - public N and() { - return (N) V1alpha1VolumeAttributesClassFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java deleted file mode 100644 index 3f5d9ed501..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha1VolumeAttributesClassListBuilder extends V1alpha1VolumeAttributesClassListFluent implements VisitableBuilder{ - public V1alpha1VolumeAttributesClassListBuilder() { - this(new V1alpha1VolumeAttributesClassList()); - } - - public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassListFluent fluent) { - this(fluent, new V1alpha1VolumeAttributesClassList()); - } - - public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassListFluent fluent,V1alpha1VolumeAttributesClassList instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha1VolumeAttributesClassListBuilder(V1alpha1VolumeAttributesClassList instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha1VolumeAttributesClassListFluent fluent; - - public V1alpha1VolumeAttributesClassList build() { - V1alpha1VolumeAttributesClassList buildable = new V1alpha1VolumeAttributesClassList(); - buildable.setApiVersion(fluent.getApiVersion()); - buildable.setItems(fluent.buildItems()); - buildable.setKind(fluent.getKind()); - buildable.setMetadata(fluent.buildMetadata()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java deleted file mode 100644 index 2af3a169ca..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassListFluent.java +++ /dev/null @@ -1,408 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.util.ArrayList; -import java.lang.String; -import java.util.function.Predicate; -import java.lang.RuntimeException; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.Objects; -import java.util.Collection; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha1VolumeAttributesClassListFluent> extends BaseFluent{ - public V1alpha1VolumeAttributesClassListFluent() { - } - - public V1alpha1VolumeAttributesClassListFluent(V1alpha1VolumeAttributesClassList instance) { - this.copyInstance(instance); - } - private String apiVersion; - private ArrayList items; - private String kind; - private V1ListMetaBuilder metadata; - - protected void copyInstance(V1alpha1VolumeAttributesClassList instance) { - instance = instance != null ? instance : new V1alpha1VolumeAttributesClassList(); - if (instance != null) { - this.withApiVersion(instance.getApiVersion()); - this.withItems(instance.getItems()); - this.withKind(instance.getKind()); - this.withMetadata(instance.getMetadata()); - } - } - - public String getApiVersion() { - return this.apiVersion; - } - - public A withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return (A) this; - } - - public boolean hasApiVersion() { - return this.apiVersion != null; - } - - public A addToItems(int index,V1alpha1VolumeAttributesClass item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.add(index, builder); - } - return (A) this; - } - - public A setToItems(int index,V1alpha1VolumeAttributesClass item) { - if (this.items == null) { - this.items = new ArrayList(); - } - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - if (index < 0 || index >= items.size()) { - _visitables.get("items").add(builder); - items.add(builder); - } else { - _visitables.get("items").add(builder); - items.set(index, builder); - } - return (A) this; - } - - public A addToItems(V1alpha1VolumeAttributesClass... items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1VolumeAttributesClass item : items) { - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A addAllToItems(Collection items) { - if (this.items == null) { - this.items = new ArrayList(); - } - for (V1alpha1VolumeAttributesClass item : items) { - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - _visitables.get("items").add(builder); - this.items.add(builder); - } - return (A) this; - } - - public A removeFromItems(V1alpha1VolumeAttributesClass... items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1VolumeAttributesClass item : items) { - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeAllFromItems(Collection items) { - if (this.items == null) { - return (A) this; - } - for (V1alpha1VolumeAttributesClass item : items) { - V1alpha1VolumeAttributesClassBuilder builder = new V1alpha1VolumeAttributesClassBuilder(item); - _visitables.get("items").remove(builder); - this.items.remove(builder); - } - return (A) this; - } - - public A removeMatchingFromItems(Predicate predicate) { - if (items == null) { - return (A) this; - } - Iterator each = items.iterator(); - List visitables = _visitables.get("items"); - while (each.hasNext()) { - V1alpha1VolumeAttributesClassBuilder builder = each.next(); - if (predicate.test(builder)) { - visitables.remove(builder); - each.remove(); - } - } - return (A) this; - } - - public List buildItems() { - return this.items != null ? build(items) : null; - } - - public V1alpha1VolumeAttributesClass buildItem(int index) { - return this.items.get(index).build(); - } - - public V1alpha1VolumeAttributesClass buildFirstItem() { - return this.items.get(0).build(); - } - - public V1alpha1VolumeAttributesClass buildLastItem() { - return this.items.get(items.size() - 1).build(); - } - - public V1alpha1VolumeAttributesClass buildMatchingItem(Predicate predicate) { - for (V1alpha1VolumeAttributesClassBuilder item : items) { - if (predicate.test(item)) { - return item.build(); - } - } - return null; - } - - public boolean hasMatchingItem(Predicate predicate) { - for (V1alpha1VolumeAttributesClassBuilder item : items) { - if (predicate.test(item)) { - return true; - } - } - return false; - } - - public A withItems(List items) { - if (this.items != null) { - this._visitables.get("items").clear(); - } - if (items != null) { - this.items = new ArrayList(); - for (V1alpha1VolumeAttributesClass item : items) { - this.addToItems(item); - } - } else { - this.items = null; - } - return (A) this; - } - - public A withItems(V1alpha1VolumeAttributesClass... items) { - if (this.items != null) { - this.items.clear(); - _visitables.remove("items"); - } - if (items != null) { - for (V1alpha1VolumeAttributesClass item : items) { - this.addToItems(item); - } - } - return (A) this; - } - - public boolean hasItems() { - return this.items != null && !(this.items.isEmpty()); - } - - public ItemsNested addNewItem() { - return new ItemsNested(-1, null); - } - - public ItemsNested addNewItemLike(V1alpha1VolumeAttributesClass item) { - return new ItemsNested(-1, item); - } - - public ItemsNested setNewItemLike(int index,V1alpha1VolumeAttributesClass item) { - return new ItemsNested(index, item); - } - - public ItemsNested editItem(int index) { - if (index <= items.size()) { - throw new RuntimeException(String.format("Can't edit %s. Index exceeds size.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editFirstItem() { - if (items.size() == 0) { - throw new RuntimeException(String.format("Can't edit first %s. The list is empty.", "items")); - } - return this.setNewItemLike(0, this.buildItem(0)); - } - - public ItemsNested editLastItem() { - int index = items.size() - 1; - if (index < 0) { - throw new RuntimeException(String.format("Can't edit last %s. The list is empty.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public ItemsNested editMatchingItem(Predicate predicate) { - int index = -1; - for (int i = 0;i < items.size();i++) { - if (predicate.test(items.get(i))) { - index = i; - break; - } - } - if (index < 0) { - throw new RuntimeException(String.format("Can't edit matching %s. No match found.", "items")); - } - return this.setNewItemLike(index, this.buildItem(index)); - } - - public String getKind() { - return this.kind; - } - - public A withKind(String kind) { - this.kind = kind; - return (A) this; - } - - public boolean hasKind() { - return this.kind != null; - } - - public V1ListMeta buildMetadata() { - return this.metadata != null ? this.metadata.build() : null; - } - - public A withMetadata(V1ListMeta metadata) { - this._visitables.remove("metadata"); - if (metadata != null) { - this.metadata = new V1ListMetaBuilder(metadata); - this._visitables.get("metadata").add(this.metadata); - } else { - this.metadata = null; - this._visitables.get("metadata").remove(this.metadata); - } - return (A) this; - } - - public boolean hasMetadata() { - return this.metadata != null; - } - - public MetadataNested withNewMetadata() { - return new MetadataNested(null); - } - - public MetadataNested withNewMetadataLike(V1ListMeta item) { - return new MetadataNested(item); - } - - public MetadataNested editMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(null)); - } - - public MetadataNested editOrNewMetadata() { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(new V1ListMetaBuilder().build())); - } - - public MetadataNested editOrNewMetadataLike(V1ListMeta item) { - return this.withNewMetadataLike(Optional.ofNullable(this.buildMetadata()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha1VolumeAttributesClassListFluent that = (V1alpha1VolumeAttributesClassListFluent) o; - if (!(Objects.equals(apiVersion, that.apiVersion))) { - return false; - } - if (!(Objects.equals(items, that.items))) { - return false; - } - if (!(Objects.equals(kind, that.kind))) { - return false; - } - if (!(Objects.equals(metadata, that.metadata))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(apiVersion == null)) { - sb.append("apiVersion:"); - sb.append(apiVersion); - sb.append(","); - } - if (!(items == null) && !(items.isEmpty())) { - sb.append("items:"); - sb.append(items); - sb.append(","); - } - if (!(kind == null)) { - sb.append("kind:"); - sb.append(kind); - sb.append(","); - } - if (!(metadata == null)) { - sb.append("metadata:"); - sb.append(metadata); - } - sb.append("}"); - return sb.toString(); - } - public class ItemsNested extends V1alpha1VolumeAttributesClassFluent> implements Nested{ - ItemsNested(int index,V1alpha1VolumeAttributesClass item) { - this.index = index; - this.builder = new V1alpha1VolumeAttributesClassBuilder(this, item); - } - V1alpha1VolumeAttributesClassBuilder builder; - int index; - - public N and() { - return (N) V1alpha1VolumeAttributesClassListFluent.this.setToItems(index, builder.build()); - } - - public N endItem() { - return and(); - } - - - } - public class MetadataNested extends V1ListMetaFluent> implements Nested{ - MetadataNested(V1ListMeta item) { - this.builder = new V1ListMetaBuilder(this, item); - } - V1ListMetaBuilder builder; - - public N and() { - return (N) V1alpha1VolumeAttributesClassListFluent.this.withMetadata(builder.build()); - } - - public N endMetadata() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java deleted file mode 100644 index b1315f31cb..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha3CELDeviceSelectorBuilder extends V1alpha3CELDeviceSelectorFluent implements VisitableBuilder{ - public V1alpha3CELDeviceSelectorBuilder() { - this(new V1alpha3CELDeviceSelector()); - } - - public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelectorFluent fluent) { - this(fluent, new V1alpha3CELDeviceSelector()); - } - - public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelectorFluent fluent,V1alpha3CELDeviceSelector instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha3CELDeviceSelectorBuilder(V1alpha3CELDeviceSelector instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha3CELDeviceSelectorFluent fluent; - - public V1alpha3CELDeviceSelector build() { - V1alpha3CELDeviceSelector buildable = new V1alpha3CELDeviceSelector(); - buildable.setExpression(fluent.getExpression()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java deleted file mode 100644 index 3c4cf6b918..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelectorFluent.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; -import java.lang.String; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha3CELDeviceSelectorFluent> extends BaseFluent{ - public V1alpha3CELDeviceSelectorFluent() { - } - - public V1alpha3CELDeviceSelectorFluent(V1alpha3CELDeviceSelector instance) { - this.copyInstance(instance); - } - private String expression; - - protected void copyInstance(V1alpha3CELDeviceSelector instance) { - instance = instance != null ? instance : new V1alpha3CELDeviceSelector(); - if (instance != null) { - this.withExpression(instance.getExpression()); - } - } - - public String getExpression() { - return this.expression; - } - - public A withExpression(String expression) { - this.expression = expression; - return (A) this; - } - - public boolean hasExpression() { - return this.expression != null; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha3CELDeviceSelectorFluent that = (V1alpha3CELDeviceSelectorFluent) o; - if (!(Objects.equals(expression, that.expression))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(expression); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(expression == null)) { - sb.append("expression:"); - sb.append(expression); - } - sb.append("}"); - return sb.toString(); - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java deleted file mode 100644 index 9769e4a9b1..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import io.kubernetes.client.fluent.VisitableBuilder; -import java.lang.Object; -public class V1alpha3DeviceSelectorBuilder extends V1alpha3DeviceSelectorFluent implements VisitableBuilder{ - public V1alpha3DeviceSelectorBuilder() { - this(new V1alpha3DeviceSelector()); - } - - public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelectorFluent fluent) { - this(fluent, new V1alpha3DeviceSelector()); - } - - public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelectorFluent fluent,V1alpha3DeviceSelector instance) { - this.fluent = fluent; - fluent.copyInstance(instance); - } - - public V1alpha3DeviceSelectorBuilder(V1alpha3DeviceSelector instance) { - this.fluent = this; - this.copyInstance(instance); - } - V1alpha3DeviceSelectorFluent fluent; - - public V1alpha3DeviceSelector build() { - V1alpha3DeviceSelector buildable = new V1alpha3DeviceSelector(); - buildable.setCel(fluent.buildCel()); - return buildable; - } - - -} \ No newline at end of file diff --git a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java b/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java deleted file mode 100644 index 908851fc9e..0000000000 --- a/fluent/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelectorFluent.java +++ /dev/null @@ -1,120 +0,0 @@ -package io.kubernetes.client.openapi.models; - -import java.lang.StringBuilder; -import java.util.Optional; -import java.lang.SuppressWarnings; -import io.kubernetes.client.fluent.Nested; -import java.lang.String; -import io.kubernetes.client.fluent.BaseFluent; -import java.util.Objects; -import java.lang.Object; - -/** - * Generated - */ -@SuppressWarnings("unchecked") -public class V1alpha3DeviceSelectorFluent> extends BaseFluent{ - public V1alpha3DeviceSelectorFluent() { - } - - public V1alpha3DeviceSelectorFluent(V1alpha3DeviceSelector instance) { - this.copyInstance(instance); - } - private V1alpha3CELDeviceSelectorBuilder cel; - - protected void copyInstance(V1alpha3DeviceSelector instance) { - instance = instance != null ? instance : new V1alpha3DeviceSelector(); - if (instance != null) { - this.withCel(instance.getCel()); - } - } - - public V1alpha3CELDeviceSelector buildCel() { - return this.cel != null ? this.cel.build() : null; - } - - public A withCel(V1alpha3CELDeviceSelector cel) { - this._visitables.remove("cel"); - if (cel != null) { - this.cel = new V1alpha3CELDeviceSelectorBuilder(cel); - this._visitables.get("cel").add(this.cel); - } else { - this.cel = null; - this._visitables.get("cel").remove(this.cel); - } - return (A) this; - } - - public boolean hasCel() { - return this.cel != null; - } - - public CelNested withNewCel() { - return new CelNested(null); - } - - public CelNested withNewCelLike(V1alpha3CELDeviceSelector item) { - return new CelNested(item); - } - - public CelNested editCel() { - return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(null)); - } - - public CelNested editOrNewCel() { - return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(new V1alpha3CELDeviceSelectorBuilder().build())); - } - - public CelNested editOrNewCelLike(V1alpha3CELDeviceSelector item) { - return this.withNewCelLike(Optional.ofNullable(this.buildCel()).orElse(item)); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - if (!(super.equals(o))) { - return false; - } - V1alpha3DeviceSelectorFluent that = (V1alpha3DeviceSelectorFluent) o; - if (!(Objects.equals(cel, that.cel))) { - return false; - } - return true; - } - - public int hashCode() { - return Objects.hash(cel); - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (!(cel == null)) { - sb.append("cel:"); - sb.append(cel); - } - sb.append("}"); - return sb.toString(); - } - public class CelNested extends V1alpha3CELDeviceSelectorFluent> implements Nested{ - CelNested(V1alpha3CELDeviceSelector item) { - this.builder = new V1alpha3CELDeviceSelectorBuilder(this, item); - } - V1alpha3CELDeviceSelectorBuilder builder; - - public N and() { - return (N) V1alpha3DeviceSelectorFluent.this.withCel(builder.build()); - } - - public N endCel() { - return and(); - } - - - } - -} \ No newline at end of file diff --git a/kubernetes/docs/StorageV1alpha1Api.md b/kubernetes/docs/StorageV1alpha1Api.md deleted file mode 100644 index 4a704f6eab..0000000000 --- a/kubernetes/docs/StorageV1alpha1Api.md +++ /dev/null @@ -1,671 +0,0 @@ -# StorageV1alpha1Api - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createVolumeAttributesClass**](StorageV1alpha1Api.md#createVolumeAttributesClass) | **POST** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | -[**deleteCollectionVolumeAttributesClass**](StorageV1alpha1Api.md#deleteCollectionVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | -[**deleteVolumeAttributesClass**](StorageV1alpha1Api.md#deleteVolumeAttributesClass) | **DELETE** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | -[**getAPIResources**](StorageV1alpha1Api.md#getAPIResources) | **GET** /apis/storage.k8s.io/v1alpha1/ | -[**listVolumeAttributesClass**](StorageV1alpha1Api.md#listVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses | -[**patchVolumeAttributesClass**](StorageV1alpha1Api.md#patchVolumeAttributesClass) | **PATCH** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | -[**readVolumeAttributesClass**](StorageV1alpha1Api.md#readVolumeAttributesClass) | **GET** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | -[**replaceVolumeAttributesClass**](StorageV1alpha1Api.md#replaceVolumeAttributesClass) | **PUT** /apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name} | - - - -# **createVolumeAttributesClass** -> V1alpha1VolumeAttributesClass createVolumeAttributesClass(body, pretty, dryRun, fieldManager, fieldValidation) - - - -create a VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - V1alpha1VolumeAttributesClass body = new V1alpha1VolumeAttributesClass(); // V1alpha1VolumeAttributesClass | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - try { - V1alpha1VolumeAttributesClass result = apiInstance.createVolumeAttributesClass(body, pretty, dryRun, fieldManager, fieldValidation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#createVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md)| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**202** | Accepted | - | -**401** | Unauthorized | - | - - -# **deleteCollectionVolumeAttributesClass** -> V1Status deleteCollectionVolumeAttributesClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body) - - - -delete collection of VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. - Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. - Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it - String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. - Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. - Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. - String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. - String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. - Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. - V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | - try { - V1Status result = apiInstance.deleteCollectionVolumeAttributesClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#deleteCollectionVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] - **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] - **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] - **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] - **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] - **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] - **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] - **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] - **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] - **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] - -### Return type - -[**V1Status**](V1Status.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **deleteVolumeAttributesClass** -> V1alpha1VolumeAttributesClass deleteVolumeAttributesClass(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body) - - - -delete a VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the VolumeAttributesClass - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. - Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it - Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. - String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. - V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | - try { - V1alpha1VolumeAttributesClass result = apiInstance.deleteVolumeAttributesClass(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#deleteVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the VolumeAttributesClass | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] - **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] - **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] - **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] - **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**202** | Accepted | - | -**401** | Unauthorized | - | - - -# **getAPIResources** -> V1APIResourceList getAPIResources() - - - -get available resources - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - try { - V1APIResourceList result = apiInstance.getAPIResources(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#getAPIResources"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**V1APIResourceList**](V1APIResourceList.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **listVolumeAttributesClass** -> V1alpha1VolumeAttributesClassList listVolumeAttributesClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch) - - - -list or watch objects of kind VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - Boolean allowWatchBookmarks = true; // Boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. - String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. - String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. - String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. - Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. - String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. - Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. - Boolean watch = true; // Boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. - try { - V1alpha1VolumeAttributesClassList result = apiInstance.listVolumeAttributesClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#listVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **allowWatchBookmarks** | **Boolean**| allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. | [optional] - **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] - **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] - **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] - **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] - **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] - **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] - **watch** | **Boolean**| Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClassList**](V1alpha1VolumeAttributesClassList.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **patchVolumeAttributesClass** -> V1alpha1VolumeAttributesClass patchVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation, force) - - - -partially update the specified VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the VolumeAttributesClass - V1Patch body = new V1Patch(); // V1Patch | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. - try { - V1alpha1VolumeAttributesClass result = apiInstance.patchVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#patchVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the VolumeAttributesClass | - **body** | **V1Patch**| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - - -# **readVolumeAttributesClass** -> V1alpha1VolumeAttributesClass readVolumeAttributesClass(name, pretty) - - - -read the specified VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the VolumeAttributesClass - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - try { - V1alpha1VolumeAttributesClass result = apiInstance.readVolumeAttributesClass(name, pretty); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#readVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the VolumeAttributesClass | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **replaceVolumeAttributesClass** -> V1alpha1VolumeAttributesClass replaceVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation) - - - -replace the specified VolumeAttributesClass - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StorageV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StorageV1alpha1Api apiInstance = new StorageV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the VolumeAttributesClass - V1alpha1VolumeAttributesClass body = new V1alpha1VolumeAttributesClass(); // V1alpha1VolumeAttributesClass | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - try { - V1alpha1VolumeAttributesClass result = apiInstance.replaceVolumeAttributesClass(name, body, pretty, dryRun, fieldManager, fieldValidation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StorageV1alpha1Api#replaceVolumeAttributesClass"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the VolumeAttributesClass | - **body** | [**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md)| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[**V1alpha1VolumeAttributesClass**](V1alpha1VolumeAttributesClass.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - diff --git a/kubernetes/docs/StoragemigrationV1alpha1Api.md b/kubernetes/docs/StoragemigrationV1alpha1Api.md deleted file mode 100644 index 8f709073c1..0000000000 --- a/kubernetes/docs/StoragemigrationV1alpha1Api.md +++ /dev/null @@ -1,910 +0,0 @@ -# StoragemigrationV1alpha1Api - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createStorageVersionMigration**](StoragemigrationV1alpha1Api.md#createStorageVersionMigration) | **POST** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | -[**deleteCollectionStorageVersionMigration**](StoragemigrationV1alpha1Api.md#deleteCollectionStorageVersionMigration) | **DELETE** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | -[**deleteStorageVersionMigration**](StoragemigrationV1alpha1Api.md#deleteStorageVersionMigration) | **DELETE** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | -[**getAPIResources**](StoragemigrationV1alpha1Api.md#getAPIResources) | **GET** /apis/storagemigration.k8s.io/v1alpha1/ | -[**listStorageVersionMigration**](StoragemigrationV1alpha1Api.md#listStorageVersionMigration) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations | -[**patchStorageVersionMigration**](StoragemigrationV1alpha1Api.md#patchStorageVersionMigration) | **PATCH** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | -[**patchStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#patchStorageVersionMigrationStatus) | **PATCH** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | -[**readStorageVersionMigration**](StoragemigrationV1alpha1Api.md#readStorageVersionMigration) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | -[**readStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#readStorageVersionMigrationStatus) | **GET** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | -[**replaceStorageVersionMigration**](StoragemigrationV1alpha1Api.md#replaceStorageVersionMigration) | **PUT** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name} | -[**replaceStorageVersionMigrationStatus**](StoragemigrationV1alpha1Api.md#replaceStorageVersionMigrationStatus) | **PUT** /apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status | - - - -# **createStorageVersionMigration** -> V1alpha1StorageVersionMigration createStorageVersionMigration(body, pretty, dryRun, fieldManager, fieldValidation) - - - -create a StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - try { - V1alpha1StorageVersionMigration result = apiInstance.createStorageVersionMigration(body, pretty, dryRun, fieldManager, fieldValidation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#createStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**202** | Accepted | - | -**401** | Unauthorized | - | - - -# **deleteCollectionStorageVersionMigration** -> V1Status deleteCollectionStorageVersionMigration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body) - - - -delete collection of StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. - Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. - Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it - String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. - Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. - Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. - String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. - String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. - Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. - V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | - try { - V1Status result = apiInstance.deleteCollectionStorageVersionMigration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#deleteCollectionStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] - **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] - **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] - **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] - **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] - **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] - **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] - **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] - **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] - **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] - -### Return type - -[**V1Status**](V1Status.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **deleteStorageVersionMigration** -> V1Status deleteStorageVersionMigration(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body) - - - -delete a StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - Integer gracePeriodSeconds = 56; // Integer | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. - Boolean ignoreStoreReadErrorWithClusterBreakingPotential = true; // Boolean | if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it - Boolean orphanDependents = true; // Boolean | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. - String propagationPolicy = "propagationPolicy_example"; // String | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. - V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | - try { - V1Status result = apiInstance.deleteStorageVersionMigration(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#deleteStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **gracePeriodSeconds** | **Integer**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional] - **ignoreStoreReadErrorWithClusterBreakingPotential** | **Boolean**| if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it | [optional] - **orphanDependents** | **Boolean**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional] - **propagationPolicy** | **String**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. | [optional] - **body** | [**V1DeleteOptions**](V1DeleteOptions.md)| | [optional] - -### Return type - -[**V1Status**](V1Status.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**202** | Accepted | - | -**401** | Unauthorized | - | - - -# **getAPIResources** -> V1APIResourceList getAPIResources() - - - -get available resources - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - try { - V1APIResourceList result = apiInstance.getAPIResources(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#getAPIResources"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**V1APIResourceList**](V1APIResourceList.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **listStorageVersionMigration** -> V1alpha1StorageVersionMigrationList listStorageVersionMigration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch) - - - -list or watch objects of kind StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - Boolean allowWatchBookmarks = true; // Boolean | allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. - String _continue = "_continue_example"; // String | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. - String fieldSelector = "fieldSelector_example"; // String | A selector to restrict the list of returned objects by their fields. Defaults to everything. - String labelSelector = "labelSelector_example"; // String | A selector to restrict the list of returned objects by their labels. Defaults to everything. - Integer limit = 56; // Integer | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. - String resourceVersion = "resourceVersion_example"; // String | resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - String resourceVersionMatch = "resourceVersionMatch_example"; // String | resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset - Boolean sendInitialEvents = true; // Boolean | `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. - Integer timeoutSeconds = 56; // Integer | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. - Boolean watch = true; // Boolean | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. - try { - V1alpha1StorageVersionMigrationList result = apiInstance.listStorageVersionMigration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#listStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **allowWatchBookmarks** | **Boolean**| allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. | [optional] - **_continue** | **String**| The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | [optional] - **fieldSelector** | **String**| A selector to restrict the list of returned objects by their fields. Defaults to everything. | [optional] - **labelSelector** | **String**| A selector to restrict the list of returned objects by their labels. Defaults to everything. | [optional] - **limit** | **Integer**| limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | [optional] - **resourceVersion** | **String**| resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **resourceVersionMatch** | **String**| resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset | [optional] - **sendInitialEvents** | **Boolean**| `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. | [optional] - **timeoutSeconds** | **Integer**| Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | [optional] - **watch** | **Boolean**| Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigrationList**](V1alpha1StorageVersionMigrationList.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch, application/cbor-seq - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **patchStorageVersionMigration** -> V1alpha1StorageVersionMigration patchStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation, force) - - - -partially update the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - V1Patch body = new V1Patch(); // V1Patch | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. - try { - V1alpha1StorageVersionMigration result = apiInstance.patchStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#patchStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **body** | **V1Patch**| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - - -# **patchStorageVersionMigrationStatus** -> V1alpha1StorageVersionMigration patchStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation, force) - - - -partially update status of the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - V1Patch body = new V1Patch(); // V1Patch | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - Boolean force = true; // Boolean | Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. - try { - V1alpha1StorageVersionMigration result = apiInstance.patchStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#patchStorageVersionMigrationStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **body** | **V1Patch**| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - **force** | **Boolean**| Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - - -# **readStorageVersionMigration** -> V1alpha1StorageVersionMigration readStorageVersionMigration(name, pretty) - - - -read the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - try { - V1alpha1StorageVersionMigration result = apiInstance.readStorageVersionMigration(name, pretty); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#readStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **readStorageVersionMigrationStatus** -> V1alpha1StorageVersionMigration readStorageVersionMigrationStatus(name, pretty) - - - -read status of the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - try { - V1alpha1StorageVersionMigration result = apiInstance.readStorageVersionMigrationStatus(name, pretty); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#readStorageVersionMigrationStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Unauthorized | - | - - -# **replaceStorageVersionMigration** -> V1alpha1StorageVersionMigration replaceStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation) - - - -replace the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - try { - V1alpha1StorageVersionMigration result = apiInstance.replaceStorageVersionMigration(name, body, pretty, dryRun, fieldManager, fieldValidation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#replaceStorageVersionMigration"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - - -# **replaceStorageVersionMigrationStatus** -> V1alpha1StorageVersionMigration replaceStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation) - - - -replace status of the specified StorageVersionMigration - -### Example -```java -// Import classes: -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.auth.*; -import io.kubernetes.client.openapi.models.*; -import io.kubernetes.client.openapi.apis.StoragemigrationV1alpha1Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure API key authorization: BearerToken - ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken"); - BearerToken.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //BearerToken.setApiKeyPrefix("Token"); - - StoragemigrationV1alpha1Api apiInstance = new StoragemigrationV1alpha1Api(defaultClient); - String name = "name_example"; // String | name of the StorageVersionMigration - V1alpha1StorageVersionMigration body = new V1alpha1StorageVersionMigration(); // V1alpha1StorageVersionMigration | - String pretty = "pretty_example"; // String | If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). - String dryRun = "dryRun_example"; // String | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed - String fieldManager = "fieldManager_example"; // String | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. - String fieldValidation = "fieldValidation_example"; // String | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. - try { - V1alpha1StorageVersionMigration result = apiInstance.replaceStorageVersionMigrationStatus(name, body, pretty, dryRun, fieldManager, fieldValidation); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StoragemigrationV1alpha1Api#replaceStorageVersionMigrationStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **String**| name of the StorageVersionMigration | - **body** | [**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md)| | - **pretty** | **String**| If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). | [optional] - **dryRun** | **String**| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | [optional] - **fieldManager** | **String**| fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | [optional] - **fieldValidation** | **String**| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | [optional] - -### Return type - -[**V1alpha1StorageVersionMigration**](V1alpha1StorageVersionMigration.md) - -### Authorization - -[BearerToken](../README.md#BearerToken) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/cbor - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**201** | Created | - | -**401** | Unauthorized | - | - diff --git a/kubernetes/docs/V1alpha1GroupVersionResource.md b/kubernetes/docs/V1alpha1GroupVersionResource.md deleted file mode 100644 index e6ac68c480..0000000000 --- a/kubernetes/docs/V1alpha1GroupVersionResource.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# V1alpha1GroupVersionResource - -The names of the group, the version, and the resource. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**group** | **String** | The name of the group. | [optional] -**resource** | **String** | The name of the resource. | [optional] -**version** | **String** | The name of the version. | [optional] - - - diff --git a/kubernetes/docs/V1alpha1MigrationCondition.md b/kubernetes/docs/V1alpha1MigrationCondition.md deleted file mode 100644 index c52aa3d698..0000000000 --- a/kubernetes/docs/V1alpha1MigrationCondition.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# V1alpha1MigrationCondition - -Describes the state of a migration at a certain point. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lastUpdateTime** | [**OffsetDateTime**](OffsetDateTime.md) | The last time this condition was updated. | [optional] -**message** | **String** | A human readable message indicating details about the transition. | [optional] -**reason** | **String** | The reason for the condition's last transition. | [optional] -**status** | **String** | Status of the condition, one of True, False, Unknown. | -**type** | **String** | Type of the condition. | - - - diff --git a/kubernetes/docs/V1alpha1PodCertificateRequest.md b/kubernetes/docs/V1alpha1PodCertificateRequest.md deleted file mode 100644 index 57f492e903..0000000000 --- a/kubernetes/docs/V1alpha1PodCertificateRequest.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# V1alpha1PodCertificateRequest - -PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] -**spec** | [**V1alpha1PodCertificateRequestSpec**](V1alpha1PodCertificateRequestSpec.md) | | -**status** | [**V1alpha1PodCertificateRequestStatus**](V1alpha1PodCertificateRequestStatus.md) | | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesObject - - diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestList.md b/kubernetes/docs/V1alpha1PodCertificateRequestList.md deleted file mode 100644 index 813fda93b7..0000000000 --- a/kubernetes/docs/V1alpha1PodCertificateRequestList.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# V1alpha1PodCertificateRequestList - -PodCertificateRequestList is a collection of PodCertificateRequest objects -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**List<V1alpha1PodCertificateRequest>**](V1alpha1PodCertificateRequest.md) | items is a collection of PodCertificateRequest objects | -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesListObject - - diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md b/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md deleted file mode 100644 index 679098f546..0000000000 --- a/kubernetes/docs/V1alpha1PodCertificateRequestSpec.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# V1alpha1PodCertificateRequestSpec - -PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**maxExpirationSeconds** | **Integer** | maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. | [optional] -**nodeName** | **String** | nodeName is the name of the node the pod is assigned to. | -**nodeUID** | **String** | nodeUID is the UID of the node the pod is assigned to. | -**pkixPublicKey** | **byte[]** | pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field. | -**podName** | **String** | podName is the name of the pod into which the certificate will be mounted. | -**podUID** | **String** | podUID is the UID of the pod into which the certificate will be mounted. | -**proofOfPossession** | **byte[]** | proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign). | -**serviceAccountName** | **String** | serviceAccountName is the name of the service account the pod is running as. | -**serviceAccountUID** | **String** | serviceAccountUID is the UID of the service account the pod is running as. | -**signerName** | **String** | signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented. | - - - diff --git a/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md b/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md deleted file mode 100644 index c7088709d7..0000000000 --- a/kubernetes/docs/V1alpha1PodCertificateRequestStatus.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# V1alpha1PodCertificateRequestStatus - -PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**beginRefreshAt** | [**OffsetDateTime**](OffsetDateTime.md) | beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary. | [optional] -**certificateChain** | **String** | certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers. | [optional] -**conditions** | [**List<V1Condition>**](V1Condition.md) | conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field. | [optional] -**notAfter** | [**OffsetDateTime**](OffsetDateTime.md) | notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] -**notBefore** | [**OffsetDateTime**](OffsetDateTime.md) | notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. | [optional] - - - diff --git a/kubernetes/docs/V1alpha1StorageVersionMigration.md b/kubernetes/docs/V1alpha1StorageVersionMigration.md deleted file mode 100644 index 761cc1174c..0000000000 --- a/kubernetes/docs/V1alpha1StorageVersionMigration.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# V1alpha1StorageVersionMigration - -StorageVersionMigration represents a migration of stored data to the latest storage version. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] -**spec** | [**V1alpha1StorageVersionMigrationSpec**](V1alpha1StorageVersionMigrationSpec.md) | | [optional] -**status** | [**V1alpha1StorageVersionMigrationStatus**](V1alpha1StorageVersionMigrationStatus.md) | | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesObject - - diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationList.md b/kubernetes/docs/V1alpha1StorageVersionMigrationList.md deleted file mode 100644 index 9caae53227..0000000000 --- a/kubernetes/docs/V1alpha1StorageVersionMigrationList.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# V1alpha1StorageVersionMigrationList - -StorageVersionMigrationList is a collection of storage version migrations. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**List<V1alpha1StorageVersionMigration>**](V1alpha1StorageVersionMigration.md) | Items is the list of StorageVersionMigration | -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesListObject - - diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md b/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md deleted file mode 100644 index fd290a2607..0000000000 --- a/kubernetes/docs/V1alpha1StorageVersionMigrationSpec.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# V1alpha1StorageVersionMigrationSpec - -Spec of the storage version migration. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**continueToken** | **String** | The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration. | [optional] -**resource** | [**V1alpha1GroupVersionResource**](V1alpha1GroupVersionResource.md) | | - - - diff --git a/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md b/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md deleted file mode 100644 index 3515aad65d..0000000000 --- a/kubernetes/docs/V1alpha1StorageVersionMigrationStatus.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# V1alpha1StorageVersionMigrationStatus - -Status of the storage version migration. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**conditions** | [**List<V1alpha1MigrationCondition>**](V1alpha1MigrationCondition.md) | The latest available observations of the migration's current state. | [optional] -**resourceVersion** | **String** | ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource. | [optional] - - - diff --git a/kubernetes/docs/V1alpha1VolumeAttributesClass.md b/kubernetes/docs/V1alpha1VolumeAttributesClass.md deleted file mode 100644 index ab0f8a55f8..0000000000 --- a/kubernetes/docs/V1alpha1VolumeAttributesClass.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# V1alpha1VolumeAttributesClass - -VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**driverName** | **String** | Name of the CSI driver This field is immutable. | -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | | [optional] -**parameters** | **Map<String, String>** | parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesObject - - diff --git a/kubernetes/docs/V1alpha1VolumeAttributesClassList.md b/kubernetes/docs/V1alpha1VolumeAttributesClassList.md deleted file mode 100644 index 298e8ebd2d..0000000000 --- a/kubernetes/docs/V1alpha1VolumeAttributesClassList.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# V1alpha1VolumeAttributesClassList - -VolumeAttributesClassList is a collection of VolumeAttributesClass objects. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiVersion** | **String** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional] -**items** | [**List<V1alpha1VolumeAttributesClass>**](V1alpha1VolumeAttributesClass.md) | items is the list of VolumeAttributesClass objects. | -**kind** | **String** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional] -**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional] - - -## Implemented Interfaces - -* io.kubernetes.client.common.KubernetesListObject - - diff --git a/kubernetes/docs/V1alpha3CELDeviceSelector.md b/kubernetes/docs/V1alpha3CELDeviceSelector.md deleted file mode 100644 index b23dac3f1a..0000000000 --- a/kubernetes/docs/V1alpha3CELDeviceSelector.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# V1alpha3CELDeviceSelector - -CELDeviceSelector contains a CEL expression for selecting a device. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expression** | **String** | Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. | - - - diff --git a/kubernetes/docs/V1alpha3DeviceSelector.md b/kubernetes/docs/V1alpha3DeviceSelector.md deleted file mode 100644 index f9fbf49104..0000000000 --- a/kubernetes/docs/V1alpha3DeviceSelector.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# V1alpha3DeviceSelector - -DeviceSelector must have exactly one field set. -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cel** | [**V1alpha3CELDeviceSelector**](V1alpha3CELDeviceSelector.md) | | [optional] - - - diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java deleted file mode 100644 index a934cfb445..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java +++ /dev/null @@ -1,1356 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.apis; - -import io.kubernetes.client.openapi.ApiCallback; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.ApiResponse; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.Pair; -import io.kubernetes.client.openapi.ProgressRequestBody; -import io.kubernetes.client.openapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import io.kubernetes.client.openapi.models.V1APIResourceList; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.models.V1Status; -import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClass; -import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClassList; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class StorageV1alpha1Api { - private ApiClient localVarApiClient; - - public StorageV1alpha1Api() { - this(Configuration.getDefaultApiClient()); - } - - public StorageV1alpha1Api(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for createVolumeAttributesClass - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call createVolumeAttributesClassCall(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createVolumeAttributesClassValidateBeforeCall(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createVolumeAttributesClass(Async)"); - } - - - okhttp3.Call localVarCall = createVolumeAttributesClassCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); - return localVarCall; - - } - - /** - * - * create a VolumeAttributesClass - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return V1alpha1VolumeAttributesClass - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClass createVolumeAttributesClass(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - ApiResponse localVarResp = createVolumeAttributesClassWithHttpInfo(body, pretty, dryRun, fieldManager, fieldValidation); - return localVarResp.getData(); - } - - /** - * - * create a VolumeAttributesClass - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClass> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public ApiResponse createVolumeAttributesClassWithHttpInfo(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - okhttp3.Call localVarCall = createVolumeAttributesClassValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * create a VolumeAttributesClass - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call createVolumeAttributesClassAsync(V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createVolumeAttributesClassValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteCollectionVolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call deleteCollectionVolumeAttributesClassCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (_continue != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); - } - - if (gracePeriodSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); - } - - if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); - } - - if (labelSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (orphanDependents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); - } - - if (propagationPolicy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); - } - - if (resourceVersion != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); - } - - if (resourceVersionMatch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); - } - - if (sendInitialEvents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); - } - - if (timeoutSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCollectionVolumeAttributesClassValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); - return localVarCall; - - } - - /** - * - * delete collection of VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @return V1Status - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1Status deleteCollectionVolumeAttributesClass(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { - ApiResponse localVarResp = deleteCollectionVolumeAttributesClassWithHttpInfo(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); - return localVarResp.getData(); - } - - /** - * - * delete collection of VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @return ApiResponse<V1Status> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse deleteCollectionVolumeAttributesClassWithHttpInfo(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * delete collection of VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call deleteCollectionVolumeAttributesClassAsync(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteCollectionVolumeAttributesClassValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteVolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call deleteVolumeAttributesClassCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (gracePeriodSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); - } - - if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); - } - - if (orphanDependents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); - } - - if (propagationPolicy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVolumeAttributesClassValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling deleteVolumeAttributesClass(Async)"); - } - - - okhttp3.Call localVarCall = deleteVolumeAttributesClassCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); - return localVarCall; - - } - - /** - * - * delete a VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @return V1alpha1VolumeAttributesClass - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClass deleteVolumeAttributesClass(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { - ApiResponse localVarResp = deleteVolumeAttributesClassWithHttpInfo(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); - return localVarResp.getData(); - } - - /** - * - * delete a VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClass> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public ApiResponse deleteVolumeAttributesClassWithHttpInfo(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { - okhttp3.Call localVarCall = deleteVolumeAttributesClassValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * delete a VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call deleteVolumeAttributesClassAsync(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteVolumeAttributesClassValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAPIResources - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getAPIResourcesCall(_callback); - return localVarCall; - - } - - /** - * - * get available resources - * @return V1APIResourceList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1APIResourceList getAPIResources() throws ApiException { - ApiResponse localVarResp = getAPIResourcesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * get available resources - * @return ApiResponse<V1APIResourceList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse getAPIResourcesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * get available resources - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call getAPIResourcesAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listVolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call listVolumeAttributesClassCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (allowWatchBookmarks != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowWatchBookmarks", allowWatchBookmarks)); - } - - if (_continue != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); - } - - if (fieldSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); - } - - if (labelSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (resourceVersion != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); - } - - if (resourceVersionMatch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); - } - - if (sendInitialEvents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); - } - - if (timeoutSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); - } - - if (watch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch", "application/cbor-seq" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listVolumeAttributesClassValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listVolumeAttributesClassCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); - return localVarCall; - - } - - /** - * - * list or watch objects of kind VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @return V1alpha1VolumeAttributesClassList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClassList listVolumeAttributesClass(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { - ApiResponse localVarResp = listVolumeAttributesClassWithHttpInfo(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); - return localVarResp.getData(); - } - - /** - * - * list or watch objects of kind VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClassList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse listVolumeAttributesClassWithHttpInfo(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { - okhttp3.Call localVarCall = listVolumeAttributesClassValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * list or watch objects of kind VolumeAttributesClass - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call listVolumeAttributesClassAsync(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listVolumeAttributesClassValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for patchVolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchVolumeAttributesClassCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - if (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call patchVolumeAttributesClassValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling patchVolumeAttributesClass(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling patchVolumeAttributesClass(Async)"); - } - - - okhttp3.Call localVarCall = patchVolumeAttributesClassCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - return localVarCall; - - } - - /** - * - * partially update the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return V1alpha1VolumeAttributesClass - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClass patchVolumeAttributesClass(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - ApiResponse localVarResp = patchVolumeAttributesClassWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - return localVarResp.getData(); - } - - /** - * - * partially update the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClass> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse patchVolumeAttributesClassWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - okhttp3.Call localVarCall = patchVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * partially update the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchVolumeAttributesClassAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = patchVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for readVolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readVolumeAttributesClassCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call readVolumeAttributesClassValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling readVolumeAttributesClass(Async)"); - } - - - okhttp3.Call localVarCall = readVolumeAttributesClassCall(name, pretty, _callback); - return localVarCall; - - } - - /** - * - * read the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return V1alpha1VolumeAttributesClass - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClass readVolumeAttributesClass(String name, String pretty) throws ApiException { - ApiResponse localVarResp = readVolumeAttributesClassWithHttpInfo(name, pretty); - return localVarResp.getData(); - } - - /** - * - * read the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClass> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse readVolumeAttributesClassWithHttpInfo(String name, String pretty) throws ApiException { - okhttp3.Call localVarCall = readVolumeAttributesClassValidateBeforeCall(name, pretty, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * read the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readVolumeAttributesClassAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = readVolumeAttributesClassValidateBeforeCall(name, pretty, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceVolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceVolumeAttributesClassCall(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattributesclasses/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceVolumeAttributesClassValidateBeforeCall(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling replaceVolumeAttributesClass(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling replaceVolumeAttributesClass(Async)"); - } - - - okhttp3.Call localVarCall = replaceVolumeAttributesClassCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - return localVarCall; - - } - - /** - * - * replace the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return V1alpha1VolumeAttributesClass - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1VolumeAttributesClass replaceVolumeAttributesClass(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - ApiResponse localVarResp = replaceVolumeAttributesClassWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); - return localVarResp.getData(); - } - - /** - * - * replace the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return ApiResponse<V1alpha1VolumeAttributesClass> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse replaceVolumeAttributesClassWithHttpInfo(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - okhttp3.Call localVarCall = replaceVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * replace the specified VolumeAttributesClass - * @param name name of the VolumeAttributesClass (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceVolumeAttributesClassAsync(String name, V1alpha1VolumeAttributesClass body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceVolumeAttributesClassValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java deleted file mode 100644 index 5ffa7704ba..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StoragemigrationV1alpha1Api.java +++ /dev/null @@ -1,1807 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.apis; - -import io.kubernetes.client.openapi.ApiCallback; -import io.kubernetes.client.openapi.ApiClient; -import io.kubernetes.client.openapi.ApiException; -import io.kubernetes.client.openapi.ApiResponse; -import io.kubernetes.client.openapi.Configuration; -import io.kubernetes.client.openapi.Pair; -import io.kubernetes.client.openapi.ProgressRequestBody; -import io.kubernetes.client.openapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import io.kubernetes.client.openapi.models.V1APIResourceList; -import io.kubernetes.client.openapi.models.V1DeleteOptions; -import io.kubernetes.client.custom.V1Patch; -import io.kubernetes.client.openapi.models.V1Status; -import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigration; -import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationList; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class StoragemigrationV1alpha1Api { - private ApiClient localVarApiClient; - - public StoragemigrationV1alpha1Api() { - this(Configuration.getDefaultApiClient()); - } - - public StoragemigrationV1alpha1Api(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for createStorageVersionMigration - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call createStorageVersionMigrationCall(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createStorageVersionMigrationValidateBeforeCall(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createStorageVersionMigration(Async)"); - } - - - okhttp3.Call localVarCall = createStorageVersionMigrationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); - return localVarCall; - - } - - /** - * - * create a StorageVersionMigration - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration createStorageVersionMigration(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - ApiResponse localVarResp = createStorageVersionMigrationWithHttpInfo(body, pretty, dryRun, fieldManager, fieldValidation); - return localVarResp.getData(); - } - - /** - * - * create a StorageVersionMigration - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public ApiResponse createStorageVersionMigrationWithHttpInfo(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - okhttp3.Call localVarCall = createStorageVersionMigrationValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * create a StorageVersionMigration - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call createStorageVersionMigrationAsync(V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createStorageVersionMigrationValidateBeforeCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteCollectionStorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call deleteCollectionStorageVersionMigrationCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (_continue != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); - } - - if (gracePeriodSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); - } - - if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); - } - - if (labelSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (orphanDependents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); - } - - if (propagationPolicy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); - } - - if (resourceVersion != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); - } - - if (resourceVersionMatch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); - } - - if (sendInitialEvents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); - } - - if (timeoutSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCollectionStorageVersionMigrationValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); - return localVarCall; - - } - - /** - * - * delete collection of StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @return V1Status - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1Status deleteCollectionStorageVersionMigration(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { - ApiResponse localVarResp = deleteCollectionStorageVersionMigrationWithHttpInfo(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body); - return localVarResp.getData(); - } - - /** - * - * delete collection of StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @return ApiResponse<V1Status> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse deleteCollectionStorageVersionMigrationWithHttpInfo(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * delete collection of StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call deleteCollectionStorageVersionMigrationAsync(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteCollectionStorageVersionMigrationValidateBeforeCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteStorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call deleteStorageVersionMigrationCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (gracePeriodSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); - } - - if (ignoreStoreReadErrorWithClusterBreakingPotential != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("ignoreStoreReadErrorWithClusterBreakingPotential", ignoreStoreReadErrorWithClusterBreakingPotential)); - } - - if (orphanDependents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); - } - - if (propagationPolicy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteStorageVersionMigrationValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling deleteStorageVersionMigration(Async)"); - } - - - okhttp3.Call localVarCall = deleteStorageVersionMigrationCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); - return localVarCall; - - } - - /** - * - * delete a StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @return V1Status - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public V1Status deleteStorageVersionMigration(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { - ApiResponse localVarResp = deleteStorageVersionMigrationWithHttpInfo(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body); - return localVarResp.getData(); - } - - /** - * - * delete a StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @return ApiResponse<V1Status> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public ApiResponse deleteStorageVersionMigrationWithHttpInfo(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { - okhttp3.Call localVarCall = deleteStorageVersionMigrationValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * delete a StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional) - * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it (optional) - * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional) - * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. (optional) - * @param body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
202 Accepted -
401 Unauthorized -
- */ - public okhttp3.Call deleteStorageVersionMigrationAsync(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean ignoreStoreReadErrorWithClusterBreakingPotential, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteStorageVersionMigrationValidateBeforeCall(name, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAPIResources - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getAPIResourcesCall(_callback); - return localVarCall; - - } - - /** - * - * get available resources - * @return V1APIResourceList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1APIResourceList getAPIResources() throws ApiException { - ApiResponse localVarResp = getAPIResourcesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * get available resources - * @return ApiResponse<V1APIResourceList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse getAPIResourcesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * get available resources - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call getAPIResourcesAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listStorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call listStorageVersionMigrationCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (allowWatchBookmarks != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowWatchBookmarks", allowWatchBookmarks)); - } - - if (_continue != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); - } - - if (fieldSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); - } - - if (labelSelector != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (resourceVersion != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); - } - - if (resourceVersionMatch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); - } - - if (sendInitialEvents != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendInitialEvents", sendInitialEvents)); - } - - if (timeoutSeconds != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); - } - - if (watch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch", "application/cbor-seq" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listStorageVersionMigrationValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listStorageVersionMigrationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); - return localVarCall; - - } - - /** - * - * list or watch objects of kind StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @return V1alpha1StorageVersionMigrationList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigrationList listStorageVersionMigration(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { - ApiResponse localVarResp = listStorageVersionMigrationWithHttpInfo(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch); - return localVarResp.getData(); - } - - /** - * - * list or watch objects of kind StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigrationList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse listStorageVersionMigrationWithHttpInfo(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch) throws ApiException { - okhttp3.Call localVarCall = listStorageVersionMigrationValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * list or watch objects of kind StorageVersionMigration - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. (optional) - * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. (optional) - * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. (optional) - * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional) - * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. (optional) - * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset (optional) - * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. (optional) - * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. (optional) - * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call listStorageVersionMigrationAsync(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listStorageVersionMigrationValidateBeforeCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for patchStorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchStorageVersionMigrationCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - if (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call patchStorageVersionMigrationValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling patchStorageVersionMigration(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling patchStorageVersionMigration(Async)"); - } - - - okhttp3.Call localVarCall = patchStorageVersionMigrationCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - return localVarCall; - - } - - /** - * - * partially update the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration patchStorageVersionMigration(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - ApiResponse localVarResp = patchStorageVersionMigrationWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - return localVarResp.getData(); - } - - /** - * - * partially update the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse patchStorageVersionMigrationWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - okhttp3.Call localVarCall = patchStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * partially update the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchStorageVersionMigrationAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = patchStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for patchStorageVersionMigrationStatus - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchStorageVersionMigrationStatusCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - if (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call patchStorageVersionMigrationStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling patchStorageVersionMigrationStatus(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling patchStorageVersionMigrationStatus(Async)"); - } - - - okhttp3.Call localVarCall = patchStorageVersionMigrationStatusCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - return localVarCall; - - } - - /** - * - * partially update status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration patchStorageVersionMigrationStatus(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - ApiResponse localVarResp = patchStorageVersionMigrationStatusWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation, force); - return localVarResp.getData(); - } - - /** - * - * partially update status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse patchStorageVersionMigrationStatusWithHttpInfo(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force) throws ApiException { - okhttp3.Call localVarCall = patchStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * partially update status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call patchStorageVersionMigrationStatusAsync(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = patchStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, force, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for readStorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readStorageVersionMigrationCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call readStorageVersionMigrationValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling readStorageVersionMigration(Async)"); - } - - - okhttp3.Call localVarCall = readStorageVersionMigrationCall(name, pretty, _callback); - return localVarCall; - - } - - /** - * - * read the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration readStorageVersionMigration(String name, String pretty) throws ApiException { - ApiResponse localVarResp = readStorageVersionMigrationWithHttpInfo(name, pretty); - return localVarResp.getData(); - } - - /** - * - * read the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse readStorageVersionMigrationWithHttpInfo(String name, String pretty) throws ApiException { - okhttp3.Call localVarCall = readStorageVersionMigrationValidateBeforeCall(name, pretty, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * read the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readStorageVersionMigrationAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = readStorageVersionMigrationValidateBeforeCall(name, pretty, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for readStorageVersionMigrationStatus - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readStorageVersionMigrationStatusCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call readStorageVersionMigrationStatusValidateBeforeCall(String name, String pretty, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling readStorageVersionMigrationStatus(Async)"); - } - - - okhttp3.Call localVarCall = readStorageVersionMigrationStatusCall(name, pretty, _callback); - return localVarCall; - - } - - /** - * - * read status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration readStorageVersionMigrationStatus(String name, String pretty) throws ApiException { - ApiResponse localVarResp = readStorageVersionMigrationStatusWithHttpInfo(name, pretty); - return localVarResp.getData(); - } - - /** - * - * read status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public ApiResponse readStorageVersionMigrationStatusWithHttpInfo(String name, String pretty) throws ApiException { - okhttp3.Call localVarCall = readStorageVersionMigrationStatusValidateBeforeCall(name, pretty, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * read status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
401 Unauthorized -
- */ - public okhttp3.Call readStorageVersionMigrationStatusAsync(String name, String pretty, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = readStorageVersionMigrationStatusValidateBeforeCall(name, pretty, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceStorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceStorageVersionMigrationCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceStorageVersionMigrationValidateBeforeCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling replaceStorageVersionMigration(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling replaceStorageVersionMigration(Async)"); - } - - - okhttp3.Call localVarCall = replaceStorageVersionMigrationCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - return localVarCall; - - } - - /** - * - * replace the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration replaceStorageVersionMigration(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - ApiResponse localVarResp = replaceStorageVersionMigrationWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); - return localVarResp.getData(); - } - - /** - * - * replace the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse replaceStorageVersionMigrationWithHttpInfo(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - okhttp3.Call localVarCall = replaceStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * replace the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceStorageVersionMigrationAsync(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceStorageVersionMigrationValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for replaceStorageVersionMigrationStatus - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceStorageVersionMigrationStatusCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations/{name}/status" - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - if (pretty != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); - } - - if (dryRun != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); - } - - if (fieldManager != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); - } - - if (fieldValidation != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); - } - - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/cbor" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "BearerToken" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceStorageVersionMigrationStatusValidateBeforeCall(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException("Missing the required parameter 'name' when calling replaceStorageVersionMigrationStatus(Async)"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling replaceStorageVersionMigrationStatus(Async)"); - } - - - okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - return localVarCall; - - } - - /** - * - * replace status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return V1alpha1StorageVersionMigration - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public V1alpha1StorageVersionMigration replaceStorageVersionMigrationStatus(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - ApiResponse localVarResp = replaceStorageVersionMigrationStatusWithHttpInfo(name, body, pretty, dryRun, fieldManager, fieldValidation); - return localVarResp.getData(); - } - - /** - * - * replace status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @return ApiResponse<V1alpha1StorageVersionMigration> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public ApiResponse replaceStorageVersionMigrationStatusWithHttpInfo(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation) throws ApiException { - okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * replace status of the specified StorageVersionMigration - * @param name name of the StorageVersionMigration (required) - * @param body (required) - * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) - * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) - * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) - * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
201 Created -
401 Unauthorized -
- */ - public okhttp3.Call replaceStorageVersionMigrationStatusAsync(String name, V1alpha1StorageVersionMigration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceStorageVersionMigrationStatusValidateBeforeCall(name, body, pretty, dryRun, fieldManager, fieldValidation, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java deleted file mode 100644 index 72053af81e..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1GroupVersionResource.java +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * The names of the group, the version, and the resource. - */ -@ApiModel(description = "The names of the group, the version, and the resource.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1GroupVersionResource { - public static final String SERIALIZED_NAME_GROUP = "group"; - @SerializedName(SERIALIZED_NAME_GROUP) - private String group; - - public static final String SERIALIZED_NAME_RESOURCE = "resource"; - @SerializedName(SERIALIZED_NAME_RESOURCE) - private String resource; - - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - private String version; - - - public V1alpha1GroupVersionResource group(String group) { - - this.group = group; - return this; - } - - /** - * The name of the group. - * @return group - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group.") - - public String getGroup() { - return group; - } - - - public void setGroup(String group) { - this.group = group; - } - - - public V1alpha1GroupVersionResource resource(String resource) { - - this.resource = resource; - return this; - } - - /** - * The name of the resource. - * @return resource - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the resource.") - - public String getResource() { - return resource; - } - - - public void setResource(String resource) { - this.resource = resource; - } - - - public V1alpha1GroupVersionResource version(String version) { - - this.version = version; - return this; - } - - /** - * The name of the version. - * @return version - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the version.") - - public String getVersion() { - return version; - } - - - public void setVersion(String version) { - this.version = version; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1GroupVersionResource v1alpha1GroupVersionResource = (V1alpha1GroupVersionResource) o; - return Objects.equals(this.group, v1alpha1GroupVersionResource.group) && - Objects.equals(this.resource, v1alpha1GroupVersionResource.resource) && - Objects.equals(this.version, v1alpha1GroupVersionResource.version); - } - - @Override - public int hashCode() { - return Objects.hash(group, resource, version); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1GroupVersionResource {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java deleted file mode 100644 index 9612daa46a..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1MigrationCondition.java +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes the state of a migration at a certain point. - */ -@ApiModel(description = "Describes the state of a migration at a certain point.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1MigrationCondition { - public static final String SERIALIZED_NAME_LAST_UPDATE_TIME = "lastUpdateTime"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATE_TIME) - private OffsetDateTime lastUpdateTime; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REASON = "reason"; - @SerializedName(SERIALIZED_NAME_REASON) - private String reason; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - - public V1alpha1MigrationCondition lastUpdateTime(OffsetDateTime lastUpdateTime) { - - this.lastUpdateTime = lastUpdateTime; - return this; - } - - /** - * The last time this condition was updated. - * @return lastUpdateTime - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The last time this condition was updated.") - - public OffsetDateTime getLastUpdateTime() { - return lastUpdateTime; - } - - - public void setLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - } - - - public V1alpha1MigrationCondition message(String message) { - - this.message = message; - return this; - } - - /** - * A human readable message indicating details about the transition. - * @return message - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A human readable message indicating details about the transition.") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public V1alpha1MigrationCondition reason(String reason) { - - this.reason = reason; - return this; - } - - /** - * The reason for the condition's last transition. - * @return reason - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The reason for the condition's last transition.") - - public String getReason() { - return reason; - } - - - public void setReason(String reason) { - this.reason = reason; - } - - - public V1alpha1MigrationCondition status(String status) { - - this.status = status; - return this; - } - - /** - * Status of the condition, one of True, False, Unknown. - * @return status - **/ - @ApiModelProperty(required = true, value = "Status of the condition, one of True, False, Unknown.") - - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public V1alpha1MigrationCondition type(String type) { - - this.type = type; - return this; - } - - /** - * Type of the condition. - * @return type - **/ - @ApiModelProperty(required = true, value = "Type of the condition.") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1MigrationCondition v1alpha1MigrationCondition = (V1alpha1MigrationCondition) o; - return Objects.equals(this.lastUpdateTime, v1alpha1MigrationCondition.lastUpdateTime) && - Objects.equals(this.message, v1alpha1MigrationCondition.message) && - Objects.equals(this.reason, v1alpha1MigrationCondition.reason) && - Objects.equals(this.status, v1alpha1MigrationCondition.status) && - Objects.equals(this.type, v1alpha1MigrationCondition.type); - } - - @Override - public int hashCode() { - return Objects.hash(lastUpdateTime, message, reason, status, type); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1MigrationCondition {\n"); - sb.append(" lastUpdateTime: ").append(toIndentedString(lastUpdateTime)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java deleted file mode 100644 index 94bf17faf6..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequest.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequestSpec; -import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequestStatus; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes - */ -@ApiModel(description = "PodCertificateRequest encodes a pod requesting a certificate from a given signer. Kubelets use this API to implement podCertificate projected volumes") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1PodCertificateRequest implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha1PodCertificateRequestSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha1PodCertificateRequestStatus status; - - - public V1alpha1PodCertificateRequest apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1PodCertificateRequest kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1PodCertificateRequest metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ObjectMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - - public V1alpha1PodCertificateRequest spec(V1alpha1PodCertificateRequestSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * @return spec - **/ - @ApiModelProperty(required = true, value = "") - - public V1alpha1PodCertificateRequestSpec getSpec() { - return spec; - } - - - public void setSpec(V1alpha1PodCertificateRequestSpec spec) { - this.spec = spec; - } - - - public V1alpha1PodCertificateRequest status(V1alpha1PodCertificateRequestStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1alpha1PodCertificateRequestStatus getStatus() { - return status; - } - - - public void setStatus(V1alpha1PodCertificateRequestStatus status) { - this.status = status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1PodCertificateRequest v1alpha1PodCertificateRequest = (V1alpha1PodCertificateRequest) o; - return Objects.equals(this.apiVersion, v1alpha1PodCertificateRequest.apiVersion) && - Objects.equals(this.kind, v1alpha1PodCertificateRequest.kind) && - Objects.equals(this.metadata, v1alpha1PodCertificateRequest.metadata) && - Objects.equals(this.spec, v1alpha1PodCertificateRequest.spec) && - Objects.equals(this.status, v1alpha1PodCertificateRequest.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1PodCertificateRequest {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java deleted file mode 100644 index a2356e3f62..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestList.java +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.kubernetes.client.openapi.models.V1alpha1PodCertificateRequest; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * PodCertificateRequestList is a collection of PodCertificateRequest objects - */ -@ApiModel(description = "PodCertificateRequestList is a collection of PodCertificateRequest objects") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1PodCertificateRequestList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata; - - - public V1alpha1PodCertificateRequestList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1PodCertificateRequestList items(List items) { - - this.items = items; - return this; - } - - public V1alpha1PodCertificateRequestList addItemsItem(V1alpha1PodCertificateRequest itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * items is a collection of PodCertificateRequest objects - * @return items - **/ - @ApiModelProperty(required = true, value = "items is a collection of PodCertificateRequest objects") - - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1alpha1PodCertificateRequestList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1PodCertificateRequestList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ListMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1PodCertificateRequestList v1alpha1PodCertificateRequestList = (V1alpha1PodCertificateRequestList) o; - return Objects.equals(this.apiVersion, v1alpha1PodCertificateRequestList.apiVersion) && - Objects.equals(this.items, v1alpha1PodCertificateRequestList.items) && - Objects.equals(this.kind, v1alpha1PodCertificateRequestList.kind) && - Objects.equals(this.metadata, v1alpha1PodCertificateRequestList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1PodCertificateRequestList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java deleted file mode 100644 index a294e70ebf..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestSpec.java +++ /dev/null @@ -1,350 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. - */ -@ApiModel(description = "PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1PodCertificateRequestSpec { - public static final String SERIALIZED_NAME_MAX_EXPIRATION_SECONDS = "maxExpirationSeconds"; - @SerializedName(SERIALIZED_NAME_MAX_EXPIRATION_SECONDS) - private Integer maxExpirationSeconds; - - public static final String SERIALIZED_NAME_NODE_NAME = "nodeName"; - @SerializedName(SERIALIZED_NAME_NODE_NAME) - private String nodeName; - - public static final String SERIALIZED_NAME_NODE_U_I_D = "nodeUID"; - @SerializedName(SERIALIZED_NAME_NODE_U_I_D) - private String nodeUID; - - public static final String SERIALIZED_NAME_PKIX_PUBLIC_KEY = "pkixPublicKey"; - @SerializedName(SERIALIZED_NAME_PKIX_PUBLIC_KEY) - private byte[] pkixPublicKey; - - public static final String SERIALIZED_NAME_POD_NAME = "podName"; - @SerializedName(SERIALIZED_NAME_POD_NAME) - private String podName; - - public static final String SERIALIZED_NAME_POD_U_I_D = "podUID"; - @SerializedName(SERIALIZED_NAME_POD_U_I_D) - private String podUID; - - public static final String SERIALIZED_NAME_PROOF_OF_POSSESSION = "proofOfPossession"; - @SerializedName(SERIALIZED_NAME_PROOF_OF_POSSESSION) - private byte[] proofOfPossession; - - public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_NAME = "serviceAccountName"; - @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_NAME) - private String serviceAccountName; - - public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_U_I_D = "serviceAccountUID"; - @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_U_I_D) - private String serviceAccountUID; - - public static final String SERIALIZED_NAME_SIGNER_NAME = "signerName"; - @SerializedName(SERIALIZED_NAME_SIGNER_NAME) - private String signerName; - - - public V1alpha1PodCertificateRequestSpec maxExpirationSeconds(Integer maxExpirationSeconds) { - - this.maxExpirationSeconds = maxExpirationSeconds; - return this; - } - - /** - * maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours. - * @return maxExpirationSeconds - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.") - - public Integer getMaxExpirationSeconds() { - return maxExpirationSeconds; - } - - - public void setMaxExpirationSeconds(Integer maxExpirationSeconds) { - this.maxExpirationSeconds = maxExpirationSeconds; - } - - - public V1alpha1PodCertificateRequestSpec nodeName(String nodeName) { - - this.nodeName = nodeName; - return this; - } - - /** - * nodeName is the name of the node the pod is assigned to. - * @return nodeName - **/ - @ApiModelProperty(required = true, value = "nodeName is the name of the node the pod is assigned to.") - - public String getNodeName() { - return nodeName; - } - - - public void setNodeName(String nodeName) { - this.nodeName = nodeName; - } - - - public V1alpha1PodCertificateRequestSpec nodeUID(String nodeUID) { - - this.nodeUID = nodeUID; - return this; - } - - /** - * nodeUID is the UID of the node the pod is assigned to. - * @return nodeUID - **/ - @ApiModelProperty(required = true, value = "nodeUID is the UID of the node the pod is assigned to.") - - public String getNodeUID() { - return nodeUID; - } - - - public void setNodeUID(String nodeUID) { - this.nodeUID = nodeUID; - } - - - public V1alpha1PodCertificateRequestSpec pkixPublicKey(byte[] pkixPublicKey) { - - this.pkixPublicKey = pkixPublicKey; - return this; - } - - /** - * pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field. - * @return pkixPublicKey - **/ - @ApiModelProperty(required = true, value = "pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field.") - - public byte[] getPkixPublicKey() { - return pkixPublicKey; - } - - - public void setPkixPublicKey(byte[] pkixPublicKey) { - this.pkixPublicKey = pkixPublicKey; - } - - - public V1alpha1PodCertificateRequestSpec podName(String podName) { - - this.podName = podName; - return this; - } - - /** - * podName is the name of the pod into which the certificate will be mounted. - * @return podName - **/ - @ApiModelProperty(required = true, value = "podName is the name of the pod into which the certificate will be mounted.") - - public String getPodName() { - return podName; - } - - - public void setPodName(String podName) { - this.podName = podName; - } - - - public V1alpha1PodCertificateRequestSpec podUID(String podUID) { - - this.podUID = podUID; - return this; - } - - /** - * podUID is the UID of the pod into which the certificate will be mounted. - * @return podUID - **/ - @ApiModelProperty(required = true, value = "podUID is the UID of the pod into which the certificate will be mounted.") - - public String getPodUID() { - return podUID; - } - - - public void setPodUID(String podUID) { - this.podUID = podUID; - } - - - public V1alpha1PodCertificateRequestSpec proofOfPossession(byte[] proofOfPossession) { - - this.proofOfPossession = proofOfPossession; - return this; - } - - /** - * proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign). - * @return proofOfPossession - **/ - @ApiModelProperty(required = true, value = "proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod's UID using `pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](https://www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign).") - - public byte[] getProofOfPossession() { - return proofOfPossession; - } - - - public void setProofOfPossession(byte[] proofOfPossession) { - this.proofOfPossession = proofOfPossession; - } - - - public V1alpha1PodCertificateRequestSpec serviceAccountName(String serviceAccountName) { - - this.serviceAccountName = serviceAccountName; - return this; - } - - /** - * serviceAccountName is the name of the service account the pod is running as. - * @return serviceAccountName - **/ - @ApiModelProperty(required = true, value = "serviceAccountName is the name of the service account the pod is running as.") - - public String getServiceAccountName() { - return serviceAccountName; - } - - - public void setServiceAccountName(String serviceAccountName) { - this.serviceAccountName = serviceAccountName; - } - - - public V1alpha1PodCertificateRequestSpec serviceAccountUID(String serviceAccountUID) { - - this.serviceAccountUID = serviceAccountUID; - return this; - } - - /** - * serviceAccountUID is the UID of the service account the pod is running as. - * @return serviceAccountUID - **/ - @ApiModelProperty(required = true, value = "serviceAccountUID is the UID of the service account the pod is running as.") - - public String getServiceAccountUID() { - return serviceAccountUID; - } - - - public void setServiceAccountUID(String serviceAccountUID) { - this.serviceAccountUID = serviceAccountUID; - } - - - public V1alpha1PodCertificateRequestSpec signerName(String signerName) { - - this.signerName = signerName; - return this; - } - - /** - * signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented. - * @return signerName - **/ - @ApiModelProperty(required = true, value = "signerName indicates the requested signer. All signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented.") - - public String getSignerName() { - return signerName; - } - - - public void setSignerName(String signerName) { - this.signerName = signerName; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1PodCertificateRequestSpec v1alpha1PodCertificateRequestSpec = (V1alpha1PodCertificateRequestSpec) o; - return Objects.equals(this.maxExpirationSeconds, v1alpha1PodCertificateRequestSpec.maxExpirationSeconds) && - Objects.equals(this.nodeName, v1alpha1PodCertificateRequestSpec.nodeName) && - Objects.equals(this.nodeUID, v1alpha1PodCertificateRequestSpec.nodeUID) && - Arrays.equals(this.pkixPublicKey, v1alpha1PodCertificateRequestSpec.pkixPublicKey) && - Objects.equals(this.podName, v1alpha1PodCertificateRequestSpec.podName) && - Objects.equals(this.podUID, v1alpha1PodCertificateRequestSpec.podUID) && - Arrays.equals(this.proofOfPossession, v1alpha1PodCertificateRequestSpec.proofOfPossession) && - Objects.equals(this.serviceAccountName, v1alpha1PodCertificateRequestSpec.serviceAccountName) && - Objects.equals(this.serviceAccountUID, v1alpha1PodCertificateRequestSpec.serviceAccountUID) && - Objects.equals(this.signerName, v1alpha1PodCertificateRequestSpec.signerName); - } - - @Override - public int hashCode() { - return Objects.hash(maxExpirationSeconds, nodeName, nodeUID, Arrays.hashCode(pkixPublicKey), podName, podUID, Arrays.hashCode(proofOfPossession), serviceAccountName, serviceAccountUID, signerName); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1PodCertificateRequestSpec {\n"); - sb.append(" maxExpirationSeconds: ").append(toIndentedString(maxExpirationSeconds)).append("\n"); - sb.append(" nodeName: ").append(toIndentedString(nodeName)).append("\n"); - sb.append(" nodeUID: ").append(toIndentedString(nodeUID)).append("\n"); - sb.append(" pkixPublicKey: ").append(toIndentedString(pkixPublicKey)).append("\n"); - sb.append(" podName: ").append(toIndentedString(podName)).append("\n"); - sb.append(" podUID: ").append(toIndentedString(podUID)).append("\n"); - sb.append(" proofOfPossession: ").append(toIndentedString(proofOfPossession)).append("\n"); - sb.append(" serviceAccountName: ").append(toIndentedString(serviceAccountName)).append("\n"); - sb.append(" serviceAccountUID: ").append(toIndentedString(serviceAccountUID)).append("\n"); - sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java deleted file mode 100644 index 7d457b9356..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1PodCertificateRequestStatus.java +++ /dev/null @@ -1,226 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1Condition; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; - -/** - * PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. - */ -@ApiModel(description = "PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1PodCertificateRequestStatus { - public static final String SERIALIZED_NAME_BEGIN_REFRESH_AT = "beginRefreshAt"; - @SerializedName(SERIALIZED_NAME_BEGIN_REFRESH_AT) - private OffsetDateTime beginRefreshAt; - - public static final String SERIALIZED_NAME_CERTIFICATE_CHAIN = "certificateChain"; - @SerializedName(SERIALIZED_NAME_CERTIFICATE_CHAIN) - private String certificateChain; - - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public static final String SERIALIZED_NAME_NOT_AFTER = "notAfter"; - @SerializedName(SERIALIZED_NAME_NOT_AFTER) - private OffsetDateTime notAfter; - - public static final String SERIALIZED_NAME_NOT_BEFORE = "notBefore"; - @SerializedName(SERIALIZED_NAME_NOT_BEFORE) - private OffsetDateTime notBefore; - - - public V1alpha1PodCertificateRequestStatus beginRefreshAt(OffsetDateTime beginRefreshAt) { - - this.beginRefreshAt = beginRefreshAt; - return this; - } - - /** - * beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary. - * @return beginRefreshAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable. This field is only a hint. Kubelet may start refreshing before or after this time if necessary.") - - public OffsetDateTime getBeginRefreshAt() { - return beginRefreshAt; - } - - - public void setBeginRefreshAt(OffsetDateTime beginRefreshAt) { - this.beginRefreshAt = beginRefreshAt; - } - - - public V1alpha1PodCertificateRequestStatus certificateChain(String certificateChain) { - - this.certificateChain = certificateChain; - return this; - } - - /** - * certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers. - * @return certificateChain - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificateChain must consist of one or more PEM-formatted certificates. 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as described in section 4 of RFC5280. If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.") - - public String getCertificateChain() { - return certificateChain; - } - - - public void setCertificateChain(String certificateChain) { - this.certificateChain = certificateChain; - } - - - public V1alpha1PodCertificateRequestStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1alpha1PodCertificateRequestStatus addConditionsItem(V1Condition conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field. - * @return conditions - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "conditions applied to the request. The types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\". If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.") - - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - - public V1alpha1PodCertificateRequestStatus notAfter(OffsetDateTime notAfter) { - - this.notAfter = notAfter; - return this; - } - - /** - * notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. - * @return notAfter - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.") - - public OffsetDateTime getNotAfter() { - return notAfter; - } - - - public void setNotAfter(OffsetDateTime notAfter) { - this.notAfter = notAfter; - } - - - public V1alpha1PodCertificateRequestStatus notBefore(OffsetDateTime notBefore) { - - this.notBefore = notBefore; - return this; - } - - /** - * notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain. - * @return notBefore - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.") - - public OffsetDateTime getNotBefore() { - return notBefore; - } - - - public void setNotBefore(OffsetDateTime notBefore) { - this.notBefore = notBefore; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1PodCertificateRequestStatus v1alpha1PodCertificateRequestStatus = (V1alpha1PodCertificateRequestStatus) o; - return Objects.equals(this.beginRefreshAt, v1alpha1PodCertificateRequestStatus.beginRefreshAt) && - Objects.equals(this.certificateChain, v1alpha1PodCertificateRequestStatus.certificateChain) && - Objects.equals(this.conditions, v1alpha1PodCertificateRequestStatus.conditions) && - Objects.equals(this.notAfter, v1alpha1PodCertificateRequestStatus.notAfter) && - Objects.equals(this.notBefore, v1alpha1PodCertificateRequestStatus.notBefore); - } - - @Override - public int hashCode() { - return Objects.hash(beginRefreshAt, certificateChain, conditions, notAfter, notBefore); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1PodCertificateRequestStatus {\n"); - sb.append(" beginRefreshAt: ").append(toIndentedString(beginRefreshAt)).append("\n"); - sb.append(" certificateChain: ").append(toIndentedString(certificateChain)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" notAfter: ").append(toIndentedString(notAfter)).append("\n"); - sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java deleted file mode 100644 index 11cba244cd..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigration.java +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationSpec; -import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigrationStatus; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * StorageVersionMigration represents a migration of stored data to the latest storage version. - */ -@ApiModel(description = "StorageVersionMigration represents a migration of stored data to the latest storage version.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1StorageVersionMigration implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata; - - public static final String SERIALIZED_NAME_SPEC = "spec"; - @SerializedName(SERIALIZED_NAME_SPEC) - private V1alpha1StorageVersionMigrationSpec spec; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private V1alpha1StorageVersionMigrationStatus status; - - - public V1alpha1StorageVersionMigration apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1StorageVersionMigration kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1StorageVersionMigration metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ObjectMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - - public V1alpha1StorageVersionMigration spec(V1alpha1StorageVersionMigrationSpec spec) { - - this.spec = spec; - return this; - } - - /** - * Get spec - * @return spec - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1alpha1StorageVersionMigrationSpec getSpec() { - return spec; - } - - - public void setSpec(V1alpha1StorageVersionMigrationSpec spec) { - this.spec = spec; - } - - - public V1alpha1StorageVersionMigration status(V1alpha1StorageVersionMigrationStatus status) { - - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1alpha1StorageVersionMigrationStatus getStatus() { - return status; - } - - - public void setStatus(V1alpha1StorageVersionMigrationStatus status) { - this.status = status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1StorageVersionMigration v1alpha1StorageVersionMigration = (V1alpha1StorageVersionMigration) o; - return Objects.equals(this.apiVersion, v1alpha1StorageVersionMigration.apiVersion) && - Objects.equals(this.kind, v1alpha1StorageVersionMigration.kind) && - Objects.equals(this.metadata, v1alpha1StorageVersionMigration.metadata) && - Objects.equals(this.spec, v1alpha1StorageVersionMigration.spec) && - Objects.equals(this.status, v1alpha1StorageVersionMigration.status); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, kind, metadata, spec, status); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1StorageVersionMigration {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java deleted file mode 100644 index 35dc5a72c9..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationList.java +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.kubernetes.client.openapi.models.V1alpha1StorageVersionMigration; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * StorageVersionMigrationList is a collection of storage version migrations. - */ -@ApiModel(description = "StorageVersionMigrationList is a collection of storage version migrations.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1StorageVersionMigrationList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata; - - - public V1alpha1StorageVersionMigrationList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1StorageVersionMigrationList items(List items) { - - this.items = items; - return this; - } - - public V1alpha1StorageVersionMigrationList addItemsItem(V1alpha1StorageVersionMigration itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * Items is the list of StorageVersionMigration - * @return items - **/ - @ApiModelProperty(required = true, value = "Items is the list of StorageVersionMigration") - - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1alpha1StorageVersionMigrationList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1StorageVersionMigrationList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ListMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1StorageVersionMigrationList v1alpha1StorageVersionMigrationList = (V1alpha1StorageVersionMigrationList) o; - return Objects.equals(this.apiVersion, v1alpha1StorageVersionMigrationList.apiVersion) && - Objects.equals(this.items, v1alpha1StorageVersionMigrationList.items) && - Objects.equals(this.kind, v1alpha1StorageVersionMigrationList.kind) && - Objects.equals(this.metadata, v1alpha1StorageVersionMigrationList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1StorageVersionMigrationList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java deleted file mode 100644 index df4b271e01..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationSpec.java +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1alpha1GroupVersionResource; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * Spec of the storage version migration. - */ -@ApiModel(description = "Spec of the storage version migration.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1StorageVersionMigrationSpec { - public static final String SERIALIZED_NAME_CONTINUE_TOKEN = "continueToken"; - @SerializedName(SERIALIZED_NAME_CONTINUE_TOKEN) - private String continueToken; - - public static final String SERIALIZED_NAME_RESOURCE = "resource"; - @SerializedName(SERIALIZED_NAME_RESOURCE) - private V1alpha1GroupVersionResource resource; - - - public V1alpha1StorageVersionMigrationSpec continueToken(String continueToken) { - - this.continueToken = continueToken; - return this; - } - - /** - * The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration. - * @return continueToken - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration.") - - public String getContinueToken() { - return continueToken; - } - - - public void setContinueToken(String continueToken) { - this.continueToken = continueToken; - } - - - public V1alpha1StorageVersionMigrationSpec resource(V1alpha1GroupVersionResource resource) { - - this.resource = resource; - return this; - } - - /** - * Get resource - * @return resource - **/ - @ApiModelProperty(required = true, value = "") - - public V1alpha1GroupVersionResource getResource() { - return resource; - } - - - public void setResource(V1alpha1GroupVersionResource resource) { - this.resource = resource; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1StorageVersionMigrationSpec v1alpha1StorageVersionMigrationSpec = (V1alpha1StorageVersionMigrationSpec) o; - return Objects.equals(this.continueToken, v1alpha1StorageVersionMigrationSpec.continueToken) && - Objects.equals(this.resource, v1alpha1StorageVersionMigrationSpec.resource); - } - - @Override - public int hashCode() { - return Objects.hash(continueToken, resource); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1StorageVersionMigrationSpec {\n"); - sb.append(" continueToken: ").append(toIndentedString(continueToken)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java deleted file mode 100644 index 7f8b645964..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1StorageVersionMigrationStatus.java +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1alpha1MigrationCondition; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * Status of the storage version migration. - */ -@ApiModel(description = "Status of the storage version migration.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1StorageVersionMigrationStatus { - public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; - @SerializedName(SERIALIZED_NAME_CONDITIONS) - private List conditions = null; - - public static final String SERIALIZED_NAME_RESOURCE_VERSION = "resourceVersion"; - @SerializedName(SERIALIZED_NAME_RESOURCE_VERSION) - private String resourceVersion; - - - public V1alpha1StorageVersionMigrationStatus conditions(List conditions) { - - this.conditions = conditions; - return this; - } - - public V1alpha1StorageVersionMigrationStatus addConditionsItem(V1alpha1MigrationCondition conditionsItem) { - if (this.conditions == null) { - this.conditions = new ArrayList<>(); - } - this.conditions.add(conditionsItem); - return this; - } - - /** - * The latest available observations of the migration's current state. - * @return conditions - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The latest available observations of the migration's current state.") - - public List getConditions() { - return conditions; - } - - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - - public V1alpha1StorageVersionMigrationStatus resourceVersion(String resourceVersion) { - - this.resourceVersion = resourceVersion; - return this; - } - - /** - * ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource. - * @return resourceVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource.") - - public String getResourceVersion() { - return resourceVersion; - } - - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1StorageVersionMigrationStatus v1alpha1StorageVersionMigrationStatus = (V1alpha1StorageVersionMigrationStatus) o; - return Objects.equals(this.conditions, v1alpha1StorageVersionMigrationStatus.conditions) && - Objects.equals(this.resourceVersion, v1alpha1StorageVersionMigrationStatus.resourceVersion); - } - - @Override - public int hashCode() { - return Objects.hash(conditions, resourceVersion); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1StorageVersionMigrationStatus {\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" resourceVersion: ").append(toIndentedString(resourceVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java deleted file mode 100644 index 3753c29a20..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClass.java +++ /dev/null @@ -1,225 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ObjectMeta; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. - */ -@ApiModel(description = "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1VolumeAttributesClass implements io.kubernetes.client.common.KubernetesObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_DRIVER_NAME = "driverName"; - @SerializedName(SERIALIZED_NAME_DRIVER_NAME) - private String driverName; - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ObjectMeta metadata; - - public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; - @SerializedName(SERIALIZED_NAME_PARAMETERS) - private Map parameters = null; - - - public V1alpha1VolumeAttributesClass apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1VolumeAttributesClass driverName(String driverName) { - - this.driverName = driverName; - return this; - } - - /** - * Name of the CSI driver This field is immutable. - * @return driverName - **/ - @ApiModelProperty(required = true, value = "Name of the CSI driver This field is immutable.") - - public String getDriverName() { - return driverName; - } - - - public void setDriverName(String driverName) { - this.driverName = driverName; - } - - - public V1alpha1VolumeAttributesClass kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1VolumeAttributesClass metadata(V1ObjectMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ObjectMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ObjectMeta metadata) { - this.metadata = metadata; - } - - - public V1alpha1VolumeAttributesClass parameters(Map parameters) { - - this.parameters = parameters; - return this; - } - - public V1alpha1VolumeAttributesClass putParametersItem(String key, String parametersItem) { - if (this.parameters == null) { - this.parameters = new HashMap<>(); - } - this.parameters.put(key, parametersItem); - return this; - } - - /** - * parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field. - * @return parameters - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass. This field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.") - - public Map getParameters() { - return parameters; - } - - - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1VolumeAttributesClass v1alpha1VolumeAttributesClass = (V1alpha1VolumeAttributesClass) o; - return Objects.equals(this.apiVersion, v1alpha1VolumeAttributesClass.apiVersion) && - Objects.equals(this.driverName, v1alpha1VolumeAttributesClass.driverName) && - Objects.equals(this.kind, v1alpha1VolumeAttributesClass.kind) && - Objects.equals(this.metadata, v1alpha1VolumeAttributesClass.metadata) && - Objects.equals(this.parameters, v1alpha1VolumeAttributesClass.parameters); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, driverName, kind, metadata, parameters); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1VolumeAttributesClass {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" driverName: ").append(toIndentedString(driverName)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java deleted file mode 100644 index 2f4a4bc1f3..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha1VolumeAttributesClassList.java +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1ListMeta; -import io.kubernetes.client.openapi.models.V1alpha1VolumeAttributesClass; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * VolumeAttributesClassList is a collection of VolumeAttributesClass objects. - */ -@ApiModel(description = "VolumeAttributesClassList is a collection of VolumeAttributesClass objects.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha1VolumeAttributesClassList implements io.kubernetes.client.common.KubernetesListObject { - public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; - @SerializedName(SERIALIZED_NAME_API_VERSION) - private String apiVersion; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private String kind; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private V1ListMeta metadata; - - - public V1alpha1VolumeAttributesClassList apiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - return this; - } - - /** - * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - * @return apiVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") - - public String getApiVersion() { - return apiVersion; - } - - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - - public V1alpha1VolumeAttributesClassList items(List items) { - - this.items = items; - return this; - } - - public V1alpha1VolumeAttributesClassList addItemsItem(V1alpha1VolumeAttributesClass itemsItem) { - this.items.add(itemsItem); - return this; - } - - /** - * items is the list of VolumeAttributesClass objects. - * @return items - **/ - @ApiModelProperty(required = true, value = "items is the list of VolumeAttributesClass objects.") - - public List getItems() { - return items; - } - - - public void setItems(List items) { - this.items = items; - } - - - public V1alpha1VolumeAttributesClassList kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") - - public String getKind() { - return kind; - } - - - public void setKind(String kind) { - this.kind = kind; - } - - - public V1alpha1VolumeAttributesClassList metadata(V1ListMeta metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1ListMeta getMetadata() { - return metadata; - } - - - public void setMetadata(V1ListMeta metadata) { - this.metadata = metadata; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha1VolumeAttributesClassList v1alpha1VolumeAttributesClassList = (V1alpha1VolumeAttributesClassList) o; - return Objects.equals(this.apiVersion, v1alpha1VolumeAttributesClassList.apiVersion) && - Objects.equals(this.items, v1alpha1VolumeAttributesClassList.items) && - Objects.equals(this.kind, v1alpha1VolumeAttributesClassList.kind) && - Objects.equals(this.metadata, v1alpha1VolumeAttributesClassList.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(apiVersion, items, kind, metadata); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha1VolumeAttributesClassList {\n"); - sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java deleted file mode 100644 index f337530d03..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3CELDeviceSelector.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * CELDeviceSelector contains a CEL expression for selecting a device. - */ -@ApiModel(description = "CELDeviceSelector contains a CEL expression for selecting a device.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha3CELDeviceSelector { - public static final String SERIALIZED_NAME_EXPRESSION = "expression"; - @SerializedName(SERIALIZED_NAME_EXPRESSION) - private String expression; - - - public V1alpha3CELDeviceSelector expression(String expression) { - - this.expression = expression; - return this; - } - - /** - * Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. - * @return expression - **/ - @ApiModelProperty(required = true, value = "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.") - - public String getExpression() { - return expression; - } - - - public void setExpression(String expression) { - this.expression = expression; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3CELDeviceSelector v1alpha3CELDeviceSelector = (V1alpha3CELDeviceSelector) o; - return Objects.equals(this.expression, v1alpha3CELDeviceSelector.expression); - } - - @Override - public int hashCode() { - return Objects.hash(expression); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3CELDeviceSelector {\n"); - sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java deleted file mode 100644 index 6481d96973..0000000000 --- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1alpha3DeviceSelector.java +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.openapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.kubernetes.client.openapi.models.V1alpha3CELDeviceSelector; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * DeviceSelector must have exactly one field set. - */ -@ApiModel(description = "DeviceSelector must have exactly one field set.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-12T23:11:52.603861Z[Etc/UTC]") -public class V1alpha3DeviceSelector { - public static final String SERIALIZED_NAME_CEL = "cel"; - @SerializedName(SERIALIZED_NAME_CEL) - private V1alpha3CELDeviceSelector cel; - - - public V1alpha3DeviceSelector cel(V1alpha3CELDeviceSelector cel) { - - this.cel = cel; - return this; - } - - /** - * Get cel - * @return cel - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public V1alpha3CELDeviceSelector getCel() { - return cel; - } - - - public void setCel(V1alpha3CELDeviceSelector cel) { - this.cel = cel; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V1alpha3DeviceSelector v1alpha3DeviceSelector = (V1alpha3DeviceSelector) o; - return Objects.equals(this.cel, v1alpha3DeviceSelector.cel); - } - - @Override - public int hashCode() { - return Objects.hash(cel); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V1alpha3DeviceSelector {\n"); - sb.append(" cel: ").append(toIndentedString(cel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java deleted file mode 100644 index d6b3d5d1b7..0000000000 --- a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admission.java +++ /dev/null @@ -1,5194 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.proto; - -public final class V1alpha1Admission { - private V1alpha1Admission() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface AdmissionReviewOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReview) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *

-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - boolean hasSpec(); - /** - * - * - *
-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec(); - /** - * - * - *
-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder getSpecOrBuilder(); - - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - boolean hasStatus(); - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus(); - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder - getStatusOrBuilder(); - } - /** - * - * - *
-   * AdmissionReview describes an admission request.
-   * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReview} - */ - public static final class AdmissionReview extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReview) - AdmissionReviewOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionReview.newBuilder() to construct. - private AdmissionReview(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionReview() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionReview( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder - subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = spec_.toBuilder(); - } - spec_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(spec_); - spec_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder - subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = status_.toBuilder(); - } - status_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.Builder.class); - } - - private int bitField0_; - public static final int SPEC_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec spec_; - /** - * - * - *
-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec() { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.getDefaultInstance() - : spec_; - } - /** - * - * - *
-     * Spec describes the attributes for the admission request.
-     * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-     * cost of deserializing it.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder - getSpecOrBuilder() { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.getDefaultInstance() - : spec_; - } - - public static final int STATUS_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus status_; - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus() { - return status_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.getDefaultInstance() - : status_; - } - /** - * - * - *
-     * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-     * +optional
-     * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder - getStatusOrBuilder() { - return status_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.getDefaultInstance() - : status_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getSpec()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getStatus()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSpec()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview other = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) obj; - - boolean result = true; - result = result && (hasSpec() == other.hasSpec()); - if (hasSpec()) { - result = result && getSpec().equals(other.getSpec()); - } - result = result && (hasStatus() == other.hasStatus()); - if (hasStatus()) { - result = result && getStatus().equals(other.getStatus()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSpec()) { - hash = (37 * hash) + SPEC_FIELD_NUMBER; - hash = (53 * hash) + getSpec().hashCode(); - } - if (hasStatus()) { - hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + getStatus().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * AdmissionReview describes an admission request.
-     * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReview} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReview) - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSpecFieldBuilder(); - getStatusFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (specBuilder_ == null) { - spec_ = null; - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (statusBuilder_ == null) { - status_ = null; - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview build() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview buildPartial() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview result = - new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (specBuilder_ == null) { - result.spec_ = spec_; - } else { - result.spec_ = specBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) { - return mergeFrom((io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview.getDefaultInstance()) - return this; - if (other.hasSpec()) { - mergeSpec(other.getSpec()); - } - if (other.hasStatus()) { - mergeStatus(other.getStatus()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec spec_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder> - specBuilder_; - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec getSpec() { - if (specBuilder_ == null) { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - .getDefaultInstance() - : spec_; - } else { - return specBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public Builder setSpec( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec value) { - if (specBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - spec_ = value; - onChanged(); - } else { - specBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public Builder setSpec( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder - builderForValue) { - if (specBuilder_ == null) { - spec_ = builderForValue.build(); - onChanged(); - } else { - specBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public Builder mergeSpec( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec value) { - if (specBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && spec_ != null - && spec_ - != io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - .getDefaultInstance()) { - spec_ = - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.newBuilder(spec_) - .mergeFrom(value) - .buildPartial(); - } else { - spec_ = value; - } - onChanged(); - } else { - specBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public Builder clearSpec() { - if (specBuilder_ == null) { - spec_ = null; - onChanged(); - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder - getSpecBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder - getSpecOrBuilder() { - if (specBuilder_ != null) { - return specBuilder_.getMessageOrBuilder(); - } else { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - .getDefaultInstance() - : spec_; - } - } - /** - * - * - *
-       * Spec describes the attributes for the admission request.
-       * Since this admission controller is non-mutating the webhook should avoid setting this in its response to avoid the
-       * cost of deserializing it.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewSpec spec = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder> - getSpecFieldBuilder() { - if (specBuilder_ == null) { - specBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder>( - getSpec(), getParentForChildren(), isClean()); - spec_ = null; - } - return specBuilder_; - } - - private io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus status_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder> - statusBuilder_; - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus getStatus() { - if (statusBuilder_ == null) { - return status_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - .getDefaultInstance() - : status_; - } else { - return statusBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public Builder setStatus( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus value) { - if (statusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - status_ = value; - onChanged(); - } else { - statusBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public Builder setStatus( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder - builderForValue) { - if (statusBuilder_ == null) { - status_ = builderForValue.build(); - onChanged(); - } else { - statusBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public Builder mergeStatus( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus value) { - if (statusBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && status_ != null - && status_ - != io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - .getDefaultInstance()) { - status_ = - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.newBuilder( - status_) - .mergeFrom(value) - .buildPartial(); - } else { - status_ = value; - } - onChanged(); - } else { - statusBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder - getStatusBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getStatusFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder - getStatusOrBuilder() { - if (statusBuilder_ != null) { - return statusBuilder_.getMessageOrBuilder(); - } else { - return status_ == null - ? io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - .getDefaultInstance() - : status_; - } - } - /** - * - * - *
-       * Status is filled in by the webhook and indicates whether the admission request should be permitted.
-       * +optional
-       * 
- * - * optional .k8s.io.api.admission.v1alpha1.AdmissionReviewStatus status = 2; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder> - getStatusFieldBuilder() { - if (statusBuilder_ == null) { - statusBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder>( - getStatus(), getParentForChildren(), isClean()); - status_ = null; - } - return statusBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReview) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReview) - private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview(); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AdmissionReview parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionReview(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReview - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface AdmissionReviewSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - boolean hasKind(); - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - io.kubernetes.client.proto.Meta.GroupVersionKind getKind(); - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder(); - - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - boolean hasObject(); - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - io.kubernetes.client.proto.Runtime.RawExtension getObject(); - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder(); - - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - boolean hasOldObject(); - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - io.kubernetes.client.proto.Runtime.RawExtension getOldObject(); - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder(); - - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - boolean hasOperation(); - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - java.lang.String getOperation(); - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - com.google.protobuf.ByteString getOperationBytes(); - - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - boolean hasName(); - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - java.lang.String getName(); - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - boolean hasNamespace(); - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - java.lang.String getNamespace(); - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - com.google.protobuf.ByteString getNamespaceBytes(); - - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - boolean hasResource(); - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - io.kubernetes.client.proto.Meta.GroupVersionResource getResource(); - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder(); - - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - boolean hasSubResource(); - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - java.lang.String getSubResource(); - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - com.google.protobuf.ByteString getSubResourceBytes(); - - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - boolean hasUserInfo(); - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo(); - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder(); - } - /** - * - * - *
-   * AdmissionReviewSpec describes the admission.Attributes for the admission request.
-   * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewSpec} - */ - public static final class AdmissionReviewSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) - AdmissionReviewSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionReviewSpec.newBuilder() to construct. - private AdmissionReviewSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionReviewSpec() { - operation_ = ""; - name_ = ""; - namespace_ = ""; - subResource_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionReviewSpec( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.Meta.GroupVersionKind.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = kind_.toBuilder(); - } - kind_ = - input.readMessage( - io.kubernetes.client.proto.Meta.GroupVersionKind.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kind_); - kind_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.Runtime.RawExtension.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = object_.toBuilder(); - } - object_ = - input.readMessage( - io.kubernetes.client.proto.Runtime.RawExtension.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(object_); - object_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: - { - io.kubernetes.client.proto.Runtime.RawExtension.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = oldObject_.toBuilder(); - } - oldObject_ = - input.readMessage( - io.kubernetes.client.proto.Runtime.RawExtension.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(oldObject_); - oldObject_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 34: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000008; - operation_ = bs; - break; - } - case 42: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - name_ = bs; - break; - } - case 50: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000020; - namespace_ = bs; - break; - } - case 58: - { - io.kubernetes.client.proto.Meta.GroupVersionResource.Builder subBuilder = null; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - subBuilder = resource_.toBuilder(); - } - resource_ = - input.readMessage( - io.kubernetes.client.proto.Meta.GroupVersionResource.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resource_); - resource_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000040; - break; - } - case 66: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000080; - subResource_ = bs; - break; - } - case 74: - { - io.kubernetes.client.proto.V1Authentication.UserInfo.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - subBuilder = userInfo_.toBuilder(); - } - userInfo_ = - input.readMessage( - io.kubernetes.client.proto.V1Authentication.UserInfo.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(userInfo_); - userInfo_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000100; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder.class); - } - - private int bitField0_; - public static final int KIND_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.GroupVersionKind kind_; - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - public boolean hasKind() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - public io.kubernetes.client.proto.Meta.GroupVersionKind getKind() { - return kind_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() - : kind_; - } - /** - * - * - *
-     * Kind is the type of object being manipulated.  For example: Pod
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - */ - public io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder() { - return kind_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() - : kind_; - } - - public static final int OBJECT_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.Runtime.RawExtension object_; - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public boolean hasObject() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public io.kubernetes.client.proto.Runtime.RawExtension getObject() { - return object_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : object_; - } - /** - * - * - *
-     * Object is the object from the incoming request prior to default values being applied
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder() { - return object_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : object_; - } - - public static final int OLDOBJECT_FIELD_NUMBER = 3; - private io.kubernetes.client.proto.Runtime.RawExtension oldObject_; - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public boolean hasOldObject() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public io.kubernetes.client.proto.Runtime.RawExtension getOldObject() { - return oldObject_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : oldObject_; - } - /** - * - * - *
-     * OldObject is the existing object. Only populated for UPDATE requests.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder() { - return oldObject_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : oldObject_; - } - - public static final int OPERATION_FIELD_NUMBER = 4; - private volatile java.lang.Object operation_; - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - public boolean hasOperation() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - operation_ = s; - } - return s; - } - } - /** - * - * - *
-     * Operation is the operation being performed
-     * 
- * - * optional string operation = 4; - */ - public com.google.protobuf.ByteString getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } - } - /** - * - * - *
-     * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-     * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-     * +optional
-     * 
- * - * optional string name = 5; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAMESPACE_FIELD_NUMBER = 6; - private volatile java.lang.Object namespace_; - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - public boolean hasNamespace() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - public java.lang.String getNamespace() { - java.lang.Object ref = namespace_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - namespace_ = s; - } - return s; - } - } - /** - * - * - *
-     * Namespace is the namespace associated with the request (if any).
-     * +optional
-     * 
- * - * optional string namespace = 6; - */ - public com.google.protobuf.ByteString getNamespaceBytes() { - java.lang.Object ref = namespace_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namespace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCE_FIELD_NUMBER = 7; - private io.kubernetes.client.proto.Meta.GroupVersionResource resource_; - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public boolean hasResource() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionResource getResource() { - return resource_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() - : resource_; - } - /** - * - * - *
-     * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder() { - return resource_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() - : resource_; - } - - public static final int SUBRESOURCE_FIELD_NUMBER = 8; - private volatile java.lang.Object subResource_; - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - public boolean hasSubResource() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - public java.lang.String getSubResource() { - java.lang.Object ref = subResource_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - subResource_ = s; - } - return s; - } - } - /** - * - * - *
-     * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-     * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-     * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-     * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-     * "binding", and kind "Binding".
-     * +optional
-     * 
- * - * optional string subResource = 8; - */ - public com.google.protobuf.ByteString getSubResourceBytes() { - java.lang.Object ref = subResource_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subResource_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USERINFO_FIELD_NUMBER = 9; - private io.kubernetes.client.proto.V1Authentication.UserInfo userInfo_; - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public boolean hasUserInfo() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo() { - return userInfo_ == null - ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() - : userInfo_; - } - /** - * - * - *
-     * UserInfo is information about the requesting user
-     * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder() { - return userInfo_ == null - ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() - : userInfo_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getKind()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getObject()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, getOldObject()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, operation_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, namespace_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeMessage(7, getResource()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, subResource_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(9, getUserInfo()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKind()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getObject()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOldObject()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, operation_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, namespace_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getResource()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, subResource_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUserInfo()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec other = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) obj; - - boolean result = true; - result = result && (hasKind() == other.hasKind()); - if (hasKind()) { - result = result && getKind().equals(other.getKind()); - } - result = result && (hasObject() == other.hasObject()); - if (hasObject()) { - result = result && getObject().equals(other.getObject()); - } - result = result && (hasOldObject() == other.hasOldObject()); - if (hasOldObject()) { - result = result && getOldObject().equals(other.getOldObject()); - } - result = result && (hasOperation() == other.hasOperation()); - if (hasOperation()) { - result = result && getOperation().equals(other.getOperation()); - } - result = result && (hasName() == other.hasName()); - if (hasName()) { - result = result && getName().equals(other.getName()); - } - result = result && (hasNamespace() == other.hasNamespace()); - if (hasNamespace()) { - result = result && getNamespace().equals(other.getNamespace()); - } - result = result && (hasResource() == other.hasResource()); - if (hasResource()) { - result = result && getResource().equals(other.getResource()); - } - result = result && (hasSubResource() == other.hasSubResource()); - if (hasSubResource()) { - result = result && getSubResource().equals(other.getSubResource()); - } - result = result && (hasUserInfo() == other.hasUserInfo()); - if (hasUserInfo()) { - result = result && getUserInfo().equals(other.getUserInfo()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasKind()) { - hash = (37 * hash) + KIND_FIELD_NUMBER; - hash = (53 * hash) + getKind().hashCode(); - } - if (hasObject()) { - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - } - if (hasOldObject()) { - hash = (37 * hash) + OLDOBJECT_FIELD_NUMBER; - hash = (53 * hash) + getOldObject().hashCode(); - } - if (hasOperation()) { - hash = (37 * hash) + OPERATION_FIELD_NUMBER; - hash = (53 * hash) + getOperation().hashCode(); - } - if (hasName()) { - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - } - if (hasNamespace()) { - hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; - hash = (53 * hash) + getNamespace().hashCode(); - } - if (hasResource()) { - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - } - if (hasSubResource()) { - hash = (37 * hash) + SUBRESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getSubResource().hashCode(); - } - if (hasUserInfo()) { - hash = (37 * hash) + USERINFO_FIELD_NUMBER; - hash = (53 * hash) + getUserInfo().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * AdmissionReviewSpec describes the admission.Attributes for the admission request.
-     * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getKindFieldBuilder(); - getObjectFieldBuilder(); - getOldObjectFieldBuilder(); - getResourceFieldBuilder(); - getUserInfoFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (kindBuilder_ == null) { - kind_ = null; - } else { - kindBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (objectBuilder_ == null) { - object_ = null; - } else { - objectBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - if (oldObjectBuilder_ == null) { - oldObject_ = null; - } else { - oldObjectBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - operation_ = ""; - bitField0_ = (bitField0_ & ~0x00000008); - name_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); - namespace_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); - if (resourceBuilder_ == null) { - resource_ = null; - } else { - resourceBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000040); - subResource_ = ""; - bitField0_ = (bitField0_ & ~0x00000080); - if (userInfoBuilder_ == null) { - userInfo_ = null; - } else { - userInfoBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec build() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec buildPartial() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec result = - new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (kindBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = kindBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (objectBuilder_ == null) { - result.object_ = object_; - } else { - result.object_ = objectBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - if (oldObjectBuilder_ == null) { - result.oldObject_ = oldObject_; - } else { - result.oldObject_ = oldObjectBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.operation_ = operation_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.namespace_ = namespace_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - if (resourceBuilder_ == null) { - result.resource_ = resource_; - } else { - result.resource_ = resourceBuilder_.build(); - } - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - result.subResource_ = subResource_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000100; - } - if (userInfoBuilder_ == null) { - result.userInfo_ = userInfo_; - } else { - result.userInfo_ = userInfoBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - .getDefaultInstance()) return this; - if (other.hasKind()) { - mergeKind(other.getKind()); - } - if (other.hasObject()) { - mergeObject(other.getObject()); - } - if (other.hasOldObject()) { - mergeOldObject(other.getOldObject()); - } - if (other.hasOperation()) { - bitField0_ |= 0x00000008; - operation_ = other.operation_; - onChanged(); - } - if (other.hasName()) { - bitField0_ |= 0x00000010; - name_ = other.name_; - onChanged(); - } - if (other.hasNamespace()) { - bitField0_ |= 0x00000020; - namespace_ = other.namespace_; - onChanged(); - } - if (other.hasResource()) { - mergeResource(other.getResource()); - } - if (other.hasSubResource()) { - bitField0_ |= 0x00000080; - subResource_ = other.subResource_; - onChanged(); - } - if (other.hasUserInfo()) { - mergeUserInfo(other.getUserInfo()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.GroupVersionKind kind_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionKind, - io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, - io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder> - kindBuilder_; - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public boolean hasKind() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionKind getKind() { - if (kindBuilder_ == null) { - return kind_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() - : kind_; - } else { - return kindBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public Builder setKind(io.kubernetes.client.proto.Meta.GroupVersionKind value) { - if (kindBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - kindBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public Builder setKind( - io.kubernetes.client.proto.Meta.GroupVersionKind.Builder builderForValue) { - if (kindBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - kindBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public Builder mergeKind(io.kubernetes.client.proto.Meta.GroupVersionKind value) { - if (kindBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && kind_ != null - && kind_ != io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance()) { - kind_ = - io.kubernetes.client.proto.Meta.GroupVersionKind.newBuilder(kind_) - .mergeFrom(value) - .buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - kindBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public Builder clearKind() { - if (kindBuilder_ == null) { - kind_ = null; - onChanged(); - } else { - kindBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionKind.Builder getKindBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getKindFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder getKindOrBuilder() { - if (kindBuilder_ != null) { - return kindBuilder_.getMessageOrBuilder(); - } else { - return kind_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionKind.getDefaultInstance() - : kind_; - } - } - /** - * - * - *
-       * Kind is the type of object being manipulated.  For example: Pod
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionKind, - io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, - io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder> - getKindFieldBuilder() { - if (kindBuilder_ == null) { - kindBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionKind, - io.kubernetes.client.proto.Meta.GroupVersionKind.Builder, - io.kubernetes.client.proto.Meta.GroupVersionKindOrBuilder>( - getKind(), getParentForChildren(), isClean()); - kind_ = null; - } - return kindBuilder_; - } - - private io.kubernetes.client.proto.Runtime.RawExtension object_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> - objectBuilder_; - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public boolean hasObject() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public io.kubernetes.client.proto.Runtime.RawExtension getObject() { - if (objectBuilder_ == null) { - return object_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : object_; - } else { - return objectBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public Builder setObject(io.kubernetes.client.proto.Runtime.RawExtension value) { - if (objectBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - object_ = value; - onChanged(); - } else { - objectBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public Builder setObject( - io.kubernetes.client.proto.Runtime.RawExtension.Builder builderForValue) { - if (objectBuilder_ == null) { - object_ = builderForValue.build(); - onChanged(); - } else { - objectBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public Builder mergeObject(io.kubernetes.client.proto.Runtime.RawExtension value) { - if (objectBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && object_ != null - && object_ != io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance()) { - object_ = - io.kubernetes.client.proto.Runtime.RawExtension.newBuilder(object_) - .mergeFrom(value) - .buildPartial(); - } else { - object_ = value; - } - onChanged(); - } else { - objectBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public Builder clearObject() { - if (objectBuilder_ == null) { - object_ = null; - onChanged(); - } else { - objectBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public io.kubernetes.client.proto.Runtime.RawExtension.Builder getObjectBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getObjectFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getObjectOrBuilder() { - if (objectBuilder_ != null) { - return objectBuilder_.getMessageOrBuilder(); - } else { - return object_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : object_; - } - } - /** - * - * - *
-       * Object is the object from the incoming request prior to default values being applied
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> - getObjectFieldBuilder() { - if (objectBuilder_ == null) { - objectBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder>( - getObject(), getParentForChildren(), isClean()); - object_ = null; - } - return objectBuilder_; - } - - private io.kubernetes.client.proto.Runtime.RawExtension oldObject_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> - oldObjectBuilder_; - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public boolean hasOldObject() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public io.kubernetes.client.proto.Runtime.RawExtension getOldObject() { - if (oldObjectBuilder_ == null) { - return oldObject_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : oldObject_; - } else { - return oldObjectBuilder_.getMessage(); - } - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public Builder setOldObject(io.kubernetes.client.proto.Runtime.RawExtension value) { - if (oldObjectBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - oldObject_ = value; - onChanged(); - } else { - oldObjectBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public Builder setOldObject( - io.kubernetes.client.proto.Runtime.RawExtension.Builder builderForValue) { - if (oldObjectBuilder_ == null) { - oldObject_ = builderForValue.build(); - onChanged(); - } else { - oldObjectBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public Builder mergeOldObject(io.kubernetes.client.proto.Runtime.RawExtension value) { - if (oldObjectBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004) - && oldObject_ != null - && oldObject_ - != io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance()) { - oldObject_ = - io.kubernetes.client.proto.Runtime.RawExtension.newBuilder(oldObject_) - .mergeFrom(value) - .buildPartial(); - } else { - oldObject_ = value; - } - onChanged(); - } else { - oldObjectBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public Builder clearOldObject() { - if (oldObjectBuilder_ == null) { - oldObject_ = null; - onChanged(); - } else { - oldObjectBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public io.kubernetes.client.proto.Runtime.RawExtension.Builder getOldObjectBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getOldObjectFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - public io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder getOldObjectOrBuilder() { - if (oldObjectBuilder_ != null) { - return oldObjectBuilder_.getMessageOrBuilder(); - } else { - return oldObject_ == null - ? io.kubernetes.client.proto.Runtime.RawExtension.getDefaultInstance() - : oldObject_; - } - } - /** - * - * - *
-       * OldObject is the existing object. Only populated for UPDATE requests.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder> - getOldObjectFieldBuilder() { - if (oldObjectBuilder_ == null) { - oldObjectBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Runtime.RawExtension, - io.kubernetes.client.proto.Runtime.RawExtension.Builder, - io.kubernetes.client.proto.Runtime.RawExtensionOrBuilder>( - getOldObject(), getParentForChildren(), isClean()); - oldObject_ = null; - } - return oldObjectBuilder_; - } - - private java.lang.Object operation_ = ""; - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public boolean hasOperation() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - operation_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public com.google.protobuf.ByteString getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public Builder setOperation(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - operation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public Builder clearOperation() { - bitField0_ = (bitField0_ & ~0x00000008); - operation_ = getDefaultInstance().getOperation(); - onChanged(); - return this; - } - /** - * - * - *
-       * Operation is the operation being performed
-       * 
- * - * optional string operation = 4; - */ - public Builder setOperationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - operation_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000010); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the name of the object as presented in the request.  On a CREATE operation, the client may omit name and
-       * rely on the server to generate the name.  If that is the case, this method will return the empty string.
-       * +optional
-       * 
- * - * optional string name = 5; - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object namespace_ = ""; - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public boolean hasNamespace() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public java.lang.String getNamespace() { - java.lang.Object ref = namespace_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - namespace_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public com.google.protobuf.ByteString getNamespaceBytes() { - java.lang.Object ref = namespace_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namespace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public Builder setNamespace(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - namespace_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public Builder clearNamespace() { - bitField0_ = (bitField0_ & ~0x00000020); - namespace_ = getDefaultInstance().getNamespace(); - onChanged(); - return this; - } - /** - * - * - *
-       * Namespace is the namespace associated with the request (if any).
-       * +optional
-       * 
- * - * optional string namespace = 6; - */ - public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - namespace_ = value; - onChanged(); - return this; - } - - private io.kubernetes.client.proto.Meta.GroupVersionResource resource_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionResource, - io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, - io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder> - resourceBuilder_; - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public boolean hasResource() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionResource getResource() { - if (resourceBuilder_ == null) { - return resource_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() - : resource_; - } else { - return resourceBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public Builder setResource(io.kubernetes.client.proto.Meta.GroupVersionResource value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resource_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - bitField0_ |= 0x00000040; - return this; - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public Builder setResource( - io.kubernetes.client.proto.Meta.GroupVersionResource.Builder builderForValue) { - if (resourceBuilder_ == null) { - resource_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000040; - return this; - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public Builder mergeResource(io.kubernetes.client.proto.Meta.GroupVersionResource value) { - if (resourceBuilder_ == null) { - if (((bitField0_ & 0x00000040) == 0x00000040) - && resource_ != null - && resource_ - != io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance()) { - resource_ = - io.kubernetes.client.proto.Meta.GroupVersionResource.newBuilder(resource_) - .mergeFrom(value) - .buildPartial(); - } else { - resource_ = value; - } - onChanged(); - } else { - resourceBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000040; - return this; - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - resource_ = null; - onChanged(); - } else { - resourceBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionResource.Builder getResourceBuilder() { - bitField0_ |= 0x00000040; - onChanged(); - return getResourceFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - public io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder getResourceOrBuilder() { - if (resourceBuilder_ != null) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - return resource_ == null - ? io.kubernetes.client.proto.Meta.GroupVersionResource.getDefaultInstance() - : resource_; - } - } - /** - * - * - *
-       * Resource is the name of the resource being requested.  This is not the kind.  For example: pods
-       * 
- * - * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 7; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionResource, - io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, - io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - resourceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.GroupVersionResource, - io.kubernetes.client.proto.Meta.GroupVersionResource.Builder, - io.kubernetes.client.proto.Meta.GroupVersionResourceOrBuilder>( - getResource(), getParentForChildren(), isClean()); - resource_ = null; - } - return resourceBuilder_; - } - - private java.lang.Object subResource_ = ""; - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public boolean hasSubResource() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public java.lang.String getSubResource() { - java.lang.Object ref = subResource_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - subResource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public com.google.protobuf.ByteString getSubResourceBytes() { - java.lang.Object ref = subResource_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subResource_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public Builder setSubResource(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - subResource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public Builder clearSubResource() { - bitField0_ = (bitField0_ & ~0x00000080); - subResource_ = getDefaultInstance().getSubResource(); - onChanged(); - return this; - } - /** - * - * - *
-       * SubResource is the name of the subresource being requested.  This is a different resource, scoped to the parent
-       * resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
-       * /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
-       * pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
-       * "binding", and kind "Binding".
-       * +optional
-       * 
- * - * optional string subResource = 8; - */ - public Builder setSubResourceBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - subResource_ = value; - onChanged(); - return this; - } - - private io.kubernetes.client.proto.V1Authentication.UserInfo userInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Authentication.UserInfo, - io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, - io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder> - userInfoBuilder_; - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public boolean hasUserInfo() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public io.kubernetes.client.proto.V1Authentication.UserInfo getUserInfo() { - if (userInfoBuilder_ == null) { - return userInfo_ == null - ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() - : userInfo_; - } else { - return userInfoBuilder_.getMessage(); - } - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public Builder setUserInfo(io.kubernetes.client.proto.V1Authentication.UserInfo value) { - if (userInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - userInfo_ = value; - onChanged(); - } else { - userInfoBuilder_.setMessage(value); - } - bitField0_ |= 0x00000100; - return this; - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public Builder setUserInfo( - io.kubernetes.client.proto.V1Authentication.UserInfo.Builder builderForValue) { - if (userInfoBuilder_ == null) { - userInfo_ = builderForValue.build(); - onChanged(); - } else { - userInfoBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000100; - return this; - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public Builder mergeUserInfo(io.kubernetes.client.proto.V1Authentication.UserInfo value) { - if (userInfoBuilder_ == null) { - if (((bitField0_ & 0x00000100) == 0x00000100) - && userInfo_ != null - && userInfo_ - != io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance()) { - userInfo_ = - io.kubernetes.client.proto.V1Authentication.UserInfo.newBuilder(userInfo_) - .mergeFrom(value) - .buildPartial(); - } else { - userInfo_ = value; - } - onChanged(); - } else { - userInfoBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000100; - return this; - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public Builder clearUserInfo() { - if (userInfoBuilder_ == null) { - userInfo_ = null; - onChanged(); - } else { - userInfoBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public io.kubernetes.client.proto.V1Authentication.UserInfo.Builder getUserInfoBuilder() { - bitField0_ |= 0x00000100; - onChanged(); - return getUserInfoFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - public io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder getUserInfoOrBuilder() { - if (userInfoBuilder_ != null) { - return userInfoBuilder_.getMessageOrBuilder(); - } else { - return userInfo_ == null - ? io.kubernetes.client.proto.V1Authentication.UserInfo.getDefaultInstance() - : userInfo_; - } - } - /** - * - * - *
-       * UserInfo is information about the requesting user
-       * 
- * - * optional .k8s.io.api.authentication.v1.UserInfo userInfo = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Authentication.UserInfo, - io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, - io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder> - getUserInfoFieldBuilder() { - if (userInfoBuilder_ == null) { - userInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Authentication.UserInfo, - io.kubernetes.client.proto.V1Authentication.UserInfo.Builder, - io.kubernetes.client.proto.V1Authentication.UserInfoOrBuilder>( - getUserInfo(), getParentForChildren(), isClean()); - userInfo_ = null; - } - return userInfoBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewSpec) - private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec(); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AdmissionReviewSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionReviewSpec(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewSpec - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface AdmissionReviewStatusOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Allowed indicates whether or not the admission request was permitted.
-     * 
- * - * optional bool allowed = 1; - */ - boolean hasAllowed(); - /** - * - * - *
-     * Allowed indicates whether or not the admission request was permitted.
-     * 
- * - * optional bool allowed = 1; - */ - boolean getAllowed(); - - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - boolean hasStatus(); - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - io.kubernetes.client.proto.Meta.Status getStatus(); - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder(); - } - /** - * - * - *
-   * AdmissionReviewStatus describes the status of the admission request.
-   * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewStatus} - */ - public static final class AdmissionReviewStatus extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) - AdmissionReviewStatusOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionReviewStatus.newBuilder() to construct. - private AdmissionReviewStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionReviewStatus() { - allowed_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionReviewStatus( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: - { - bitField0_ |= 0x00000001; - allowed_ = input.readBool(); - break; - } - case 18: - { - io.kubernetes.client.proto.Meta.Status.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = status_.toBuilder(); - } - status_ = - input.readMessage( - io.kubernetes.client.proto.Meta.Status.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder.class); - } - - private int bitField0_; - public static final int ALLOWED_FIELD_NUMBER = 1; - private boolean allowed_; - /** - * - * - *
-     * Allowed indicates whether or not the admission request was permitted.
-     * 
- * - * optional bool allowed = 1; - */ - public boolean hasAllowed() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Allowed indicates whether or not the admission request was permitted.
-     * 
- * - * optional bool allowed = 1; - */ - public boolean getAllowed() { - return allowed_; - } - - public static final int STATUS_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.Meta.Status status_; - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public io.kubernetes.client.proto.Meta.Status getStatus() { - return status_ == null - ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() - : status_; - } - /** - * - * - *
-     * Result contains extra details into why an admission request was denied.
-     * This field IS NOT consulted in any way if "Allowed" is "true".
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder() { - return status_ == null - ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() - : status_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBool(1, allowed_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getStatus()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, allowed_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus other = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) obj; - - boolean result = true; - result = result && (hasAllowed() == other.hasAllowed()); - if (hasAllowed()) { - result = result && (getAllowed() == other.getAllowed()); - } - result = result && (hasStatus() == other.hasStatus()); - if (hasStatus()) { - result = result && getStatus().equals(other.getStatus()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasAllowed()) { - hash = (37 * hash) + ALLOWED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowed()); - } - if (hasStatus()) { - hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + getStatus().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * AdmissionReviewStatus describes the status of the admission request.
-     * 
- * - * Protobuf type {@code k8s.io.api.admission.v1alpha1.AdmissionReviewStatus} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatusOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.class, - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getStatusFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - allowed_ = false; - bitField0_ = (bitField0_ & ~0x00000001); - if (statusBuilder_ == null) { - status_ = null; - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admission - .internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus build() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus buildPartial() { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus result = - new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.allowed_ = allowed_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - .getDefaultInstance()) return this; - if (other.hasAllowed()) { - setAllowed(other.getAllowed()); - } - if (other.hasStatus()) { - mergeStatus(other.getStatus()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private boolean allowed_; - /** - * - * - *
-       * Allowed indicates whether or not the admission request was permitted.
-       * 
- * - * optional bool allowed = 1; - */ - public boolean hasAllowed() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Allowed indicates whether or not the admission request was permitted.
-       * 
- * - * optional bool allowed = 1; - */ - public boolean getAllowed() { - return allowed_; - } - /** - * - * - *
-       * Allowed indicates whether or not the admission request was permitted.
-       * 
- * - * optional bool allowed = 1; - */ - public Builder setAllowed(boolean value) { - bitField0_ |= 0x00000001; - allowed_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Allowed indicates whether or not the admission request was permitted.
-       * 
- * - * optional bool allowed = 1; - */ - public Builder clearAllowed() { - bitField0_ = (bitField0_ & ~0x00000001); - allowed_ = false; - onChanged(); - return this; - } - - private io.kubernetes.client.proto.Meta.Status status_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Status, - io.kubernetes.client.proto.Meta.Status.Builder, - io.kubernetes.client.proto.Meta.StatusOrBuilder> - statusBuilder_; - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public io.kubernetes.client.proto.Meta.Status getStatus() { - if (statusBuilder_ == null) { - return status_ == null - ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() - : status_; - } else { - return statusBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public Builder setStatus(io.kubernetes.client.proto.Meta.Status value) { - if (statusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - status_ = value; - onChanged(); - } else { - statusBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public Builder setStatus(io.kubernetes.client.proto.Meta.Status.Builder builderForValue) { - if (statusBuilder_ == null) { - status_ = builderForValue.build(); - onChanged(); - } else { - statusBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public Builder mergeStatus(io.kubernetes.client.proto.Meta.Status value) { - if (statusBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && status_ != null - && status_ != io.kubernetes.client.proto.Meta.Status.getDefaultInstance()) { - status_ = - io.kubernetes.client.proto.Meta.Status.newBuilder(status_) - .mergeFrom(value) - .buildPartial(); - } else { - status_ = value; - } - onChanged(); - } else { - statusBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public io.kubernetes.client.proto.Meta.Status.Builder getStatusBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getStatusFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - public io.kubernetes.client.proto.Meta.StatusOrBuilder getStatusOrBuilder() { - if (statusBuilder_ != null) { - return statusBuilder_.getMessageOrBuilder(); - } else { - return status_ == null - ? io.kubernetes.client.proto.Meta.Status.getDefaultInstance() - : status_; - } - } - /** - * - * - *
-       * Result contains extra details into why an admission request was denied.
-       * This field IS NOT consulted in any way if "Allowed" is "true".
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Status, - io.kubernetes.client.proto.Meta.Status.Builder, - io.kubernetes.client.proto.Meta.StatusOrBuilder> - getStatusFieldBuilder() { - if (statusBuilder_ == null) { - statusBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Status, - io.kubernetes.client.proto.Meta.Status.Builder, - io.kubernetes.client.proto.Meta.StatusOrBuilder>( - getStatus(), getParentForChildren(), isClean()); - status_ = null; - } - return statusBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admission.v1alpha1.AdmissionReviewStatus) - private static final io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus(); - } - - public static io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AdmissionReviewStatus parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionReviewStatus(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admission.AdmissionReviewStatus - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n-k8s.io/api/admission/v1alpha1/generate" - + "d.proto\022\035k8s.io.api.admission.v1alpha1\032," - + "k8s.io/api/authentication/v1/generated.p" - + "roto\0324k8s.io/apimachinery/pkg/apis/meta/" - + "v1/generated.proto\032/k8s.io/apimachinery/" - + "pkg/runtime/generated.proto\0326k8s.io/apim" - + "achinery/pkg/runtime/schema/generated.pr" - + "oto\0323k8s.io/apimachinery/pkg/util/intstr" - + "/generated.proto\"\231\001\n\017AdmissionReview\022@\n\004" - + "spec\030\001 \001(\01322.k8s.io.api.admission.v1alph", - "a1.AdmissionReviewSpec\022D\n\006status\030\002 \001(\01324" - + ".k8s.io.api.admission.v1alpha1.Admission" - + "ReviewStatus\"\255\003\n\023AdmissionReviewSpec\022D\n\004" - + "kind\030\001 \001(\01326.k8s.io.apimachinery.pkg.api" - + "s.meta.v1.GroupVersionKind\022=\n\006object\030\002 \001" - + "(\0132-.k8s.io.apimachinery.pkg.runtime.Raw" - + "Extension\022@\n\toldObject\030\003 \001(\0132-.k8s.io.ap" - + "imachinery.pkg.runtime.RawExtension\022\021\n\to" - + "peration\030\004 \001(\t\022\014\n\004name\030\005 \001(\t\022\021\n\tnamespac" - + "e\030\006 \001(\t\022L\n\010resource\030\007 \001(\0132:.k8s.io.apima", - "chinery.pkg.apis.meta.v1.GroupVersionRes" - + "ource\022\023\n\013subResource\030\010 \001(\t\0228\n\010userInfo\030\t" - + " \001(\0132&.k8s.io.api.authentication.v1.User" - + "Info\"f\n\025AdmissionReviewStatus\022\017\n\007allowed" - + "\030\001 \001(\010\022<\n\006status\030\002 \001(\0132,.k8s.io.apimachi" - + "nery.pkg.apis.meta.v1.StatusB9\n\032io.kuber" - + "netes.client.protoB\021V1alpha1AdmissionZ\010v" - + "1alpha1" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.kubernetes.client.proto.V1Authentication.getDescriptor(), - io.kubernetes.client.proto.Meta.getDescriptor(), - io.kubernetes.client.proto.Runtime.getDescriptor(), - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), - io.kubernetes.client.proto.IntStr.getDescriptor(), - }, - assigner); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReview_descriptor, - new java.lang.String[] { - "Spec", "Status", - }); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewSpec_descriptor, - new java.lang.String[] { - "Kind", - "Object", - "OldObject", - "Operation", - "Name", - "Namespace", - "Resource", - "SubResource", - "UserInfo", - }); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admission_v1alpha1_AdmissionReviewStatus_descriptor, - new java.lang.String[] { - "Allowed", "Status", - }); - io.kubernetes.client.proto.V1Authentication.getDescriptor(); - io.kubernetes.client.proto.Meta.getDescriptor(); - io.kubernetes.client.proto.Runtime.getDescriptor(); - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); - io.kubernetes.client.proto.IntStr.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java deleted file mode 100644 index f2c2453736..0000000000 --- a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Admissionregistration.java +++ /dev/null @@ -1,14647 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.proto; - -public final class V1alpha1Admissionregistration { - private V1alpha1Admissionregistration() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface AdmissionHookClientConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - boolean hasService(); - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference getService(); - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder - getServiceOrBuilder(); - - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - boolean hasUrlPath(); - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - java.lang.String getUrlPath(); - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - com.google.protobuf.ByteString getUrlPathBytes(); - - /** - * - * - *
-     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-     * Required
-     * 
- * - * optional bytes caBundle = 2; - */ - boolean hasCaBundle(); - /** - * - * - *
-     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-     * Required
-     * 
- * - * optional bytes caBundle = 2; - */ - com.google.protobuf.ByteString getCaBundle(); - } - /** - * - * - *
-   * AdmissionHookClientConfig contains the information to make a TLS
-   * connection with the webhook
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig} - */ - public static final class AdmissionHookClientConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) - AdmissionHookClientConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use AdmissionHookClientConfig.newBuilder() to construct. - private AdmissionHookClientConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AdmissionHookClientConfig() { - urlPath_ = ""; - caBundle_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AdmissionHookClientConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder - subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = service_.toBuilder(); - } - service_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(service_); - service_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - bitField0_ |= 0x00000004; - caBundle_ = input.readBytes(); - break; - } - case 26: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - urlPath_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder.class); - } - - private int bitField0_; - public static final int SERVICE_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference service_; - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public boolean hasService() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference getService() { - return service_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance() - : service_; - } - /** - * - * - *
-     * Service is a reference to the service for this webhook. If there is only
-     * one port open for the service, that port will be used. If there are multiple
-     * ports open, port 443 will be used if it is open, otherwise it is an error.
-     * Required
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder - getServiceOrBuilder() { - return service_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance() - : service_; - } - - public static final int URLPATH_FIELD_NUMBER = 3; - private volatile java.lang.Object urlPath_; - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - public boolean hasUrlPath() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - public java.lang.String getUrlPath() { - java.lang.Object ref = urlPath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - urlPath_ = s; - } - return s; - } - } - /** - * - * - *
-     * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-     * 
- * - * optional string urlPath = 3; - */ - public com.google.protobuf.ByteString getUrlPathBytes() { - java.lang.Object ref = urlPath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - urlPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CABUNDLE_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString caBundle_; - /** - * - * - *
-     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-     * Required
-     * 
- * - * optional bytes caBundle = 2; - */ - public boolean hasCaBundle() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-     * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-     * Required
-     * 
- * - * optional bytes caBundle = 2; - */ - public com.google.protobuf.ByteString getCaBundle() { - return caBundle_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getService()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(2, caBundle_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, urlPath_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getService()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, caBundle_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, urlPath_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) obj; - - boolean result = true; - result = result && (hasService() == other.hasService()); - if (hasService()) { - result = result && getService().equals(other.getService()); - } - result = result && (hasUrlPath() == other.hasUrlPath()); - if (hasUrlPath()) { - result = result && getUrlPath().equals(other.getUrlPath()); - } - result = result && (hasCaBundle() == other.hasCaBundle()); - if (hasCaBundle()) { - result = result && getCaBundle().equals(other.getCaBundle()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasService()) { - hash = (37 * hash) + SERVICE_FIELD_NUMBER; - hash = (53 * hash) + getService().hashCode(); - } - if (hasUrlPath()) { - hash = (37 * hash) + URLPATH_FIELD_NUMBER; - hash = (53 * hash) + getUrlPath().hashCode(); - } - if (hasCaBundle()) { - hash = (37 * hash) + CABUNDLE_FIELD_NUMBER; - hash = (53 * hash) + getCaBundle().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * AdmissionHookClientConfig contains the information to make a TLS
-     * connection with the webhook
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getServiceFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (serviceBuilder_ == null) { - service_ = null; - } else { - serviceBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - urlPath_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - caBundle_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig( - this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (serviceBuilder_ == null) { - result.service_ = service_; - } else { - result.service_ = serviceBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.urlPath_ = urlPath_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.caBundle_ = caBundle_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance()) return this; - if (other.hasService()) { - mergeService(other.getService()); - } - if (other.hasUrlPath()) { - bitField0_ |= 0x00000002; - urlPath_ = other.urlPath_; - onChanged(); - } - if (other.hasCaBundle()) { - setCaBundle(other.getCaBundle()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference service_ = - null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder> - serviceBuilder_; - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public boolean hasService() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - getService() { - if (serviceBuilder_ == null) { - return service_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance() - : service_; - } else { - return serviceBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public Builder setService( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference value) { - if (serviceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - service_ = value; - onChanged(); - } else { - serviceBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public Builder setService( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder - builderForValue) { - if (serviceBuilder_ == null) { - service_ = builderForValue.build(); - onChanged(); - } else { - serviceBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public Builder mergeService( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference value) { - if (serviceBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && service_ != null - && service_ - != io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance()) { - service_ = - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .newBuilder(service_) - .mergeFrom(value) - .buildPartial(); - } else { - service_ = value; - } - onChanged(); - } else { - serviceBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public Builder clearService() { - if (serviceBuilder_ == null) { - service_ = null; - onChanged(); - } else { - serviceBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder - getServiceBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getServiceFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder - getServiceOrBuilder() { - if (serviceBuilder_ != null) { - return serviceBuilder_.getMessageOrBuilder(); - } else { - return service_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance() - : service_; - } - } - /** - * - * - *
-       * Service is a reference to the service for this webhook. If there is only
-       * one port open for the service, that port will be used. If there are multiple
-       * ports open, port 443 will be used if it is open, otherwise it is an error.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.ServiceReference service = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder> - getServiceFieldBuilder() { - if (serviceBuilder_ == null) { - serviceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ServiceReferenceOrBuilder>(getService(), getParentForChildren(), isClean()); - service_ = null; - } - return serviceBuilder_; - } - - private java.lang.Object urlPath_ = ""; - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public boolean hasUrlPath() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public java.lang.String getUrlPath() { - java.lang.Object ref = urlPath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - urlPath_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public com.google.protobuf.ByteString getUrlPathBytes() { - java.lang.Object ref = urlPath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - urlPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public Builder setUrlPath(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - urlPath_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public Builder clearUrlPath() { - bitField0_ = (bitField0_ & ~0x00000002); - urlPath_ = getDefaultInstance().getUrlPath(); - onChanged(); - return this; - } - /** - * - * - *
-       * URLPath is an optional field that specifies the URL path to use when posting the AdmissionReview object.
-       * 
- * - * optional string urlPath = 3; - */ - public Builder setUrlPathBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - urlPath_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString caBundle_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-       * Required
-       * 
- * - * optional bytes caBundle = 2; - */ - public boolean hasCaBundle() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-       * Required
-       * 
- * - * optional bytes caBundle = 2; - */ - public com.google.protobuf.ByteString getCaBundle() { - return caBundle_; - } - /** - * - * - *
-       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-       * Required
-       * 
- * - * optional bytes caBundle = 2; - */ - public Builder setCaBundle(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - caBundle_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate.
-       * Required
-       * 
- * - * optional bytes caBundle = 2; - */ - public Builder clearCaBundle() { - bitField0_ = (bitField0_ & ~0x00000004); - caBundle_ = getDefaultInstance().getCaBundle(); - onChanged(); - return this; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfig - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AdmissionHookClientConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AdmissionHookClientConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ExternalAdmissionHookOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - boolean hasName(); - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - java.lang.String getName(); - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - boolean hasClientConfig(); - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getClientConfig(); - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfigOrBuilder - getClientConfigOrBuilder(); - - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - java.util.List - getRulesList(); - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules(int index); - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - int getRulesCount(); - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .RuleWithOperationsOrBuilder> - getRulesOrBuilderList(); - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder - getRulesOrBuilder(int index); - - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - boolean hasFailurePolicy(); - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - java.lang.String getFailurePolicy(); - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - com.google.protobuf.ByteString getFailurePolicyBytes(); - } - /** - * - * - *
-   * ExternalAdmissionHook describes an external admission webhook and the
-   * resources and operations it applies to.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook} - */ - public static final class ExternalAdmissionHook extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) - ExternalAdmissionHookOrBuilder { - private static final long serialVersionUID = 0L; - // Use ExternalAdmissionHook.newBuilder() to construct. - private ExternalAdmissionHook(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ExternalAdmissionHook() { - name_ = ""; - rules_ = java.util.Collections.emptyList(); - failurePolicy_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ExternalAdmissionHook( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - name_ = bs; - break; - } - case 18: - { - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder - subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = clientConfig_.toBuilder(); - } - clientConfig_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfig.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(clientConfig_); - clientConfig_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - rules_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .RuleWithOperations>(); - mutable_bitField0_ |= 0x00000004; - } - rules_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .PARSER, - extensionRegistry)); - break; - } - case 34: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - failurePolicy_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - .class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } - } - /** - * - * - *
-     * The name of the external admission webhook.
-     * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-     * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required.
-     * 
- * - * optional string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENTCONFIG_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - clientConfig_; - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public boolean hasClientConfig() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getClientConfig() { - return clientConfig_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance() - : clientConfig_; - } - /** - * - * - *
-     * ClientConfig defines how to communicate with the hook.
-     * Required
-     * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder - getClientConfigOrBuilder() { - return clientConfig_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance() - : clientConfig_; - } - - public static final int RULES_FIELD_NUMBER = 3; - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> - rules_; - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> - getRulesList() { - return rules_; - } - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .RuleWithOperationsOrBuilder> - getRulesOrBuilderList() { - return rules_; - } - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public int getRulesCount() { - return rules_.size(); - } - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules( - int index) { - return rules_.get(index); - } - /** - * - * - *
-     * Rules describes what operations on what resources/subresources the webhook cares about.
-     * The webhook cares about an operation if it matches _any_ Rule.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder - getRulesOrBuilder(int index) { - return rules_.get(index); - } - - public static final int FAILUREPOLICY_FIELD_NUMBER = 4; - private volatile java.lang.Object failurePolicy_; - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - public boolean hasFailurePolicy() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - public java.lang.String getFailurePolicy() { - java.lang.Object ref = failurePolicy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - failurePolicy_ = s; - } - return s; - } - } - /** - * - * - *
-     * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-     * allowed values are Ignore or Fail. Defaults to Ignore.
-     * +optional
-     * 
- * - * optional string failurePolicy = 4; - */ - public com.google.protobuf.ByteString getFailurePolicyBytes() { - java.lang.Object ref = failurePolicy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - failurePolicy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getClientConfig()); - } - for (int i = 0; i < rules_.size(); i++) { - output.writeMessage(3, rules_.get(i)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, failurePolicy_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClientConfig()); - } - for (int i = 0; i < rules_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, failurePolicy_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) obj; - - boolean result = true; - result = result && (hasName() == other.hasName()); - if (hasName()) { - result = result && getName().equals(other.getName()); - } - result = result && (hasClientConfig() == other.hasClientConfig()); - if (hasClientConfig()) { - result = result && getClientConfig().equals(other.getClientConfig()); - } - result = result && getRulesList().equals(other.getRulesList()); - result = result && (hasFailurePolicy() == other.hasFailurePolicy()); - if (hasFailurePolicy()) { - result = result && getFailurePolicy().equals(other.getFailurePolicy()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasName()) { - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - } - if (hasClientConfig()) { - hash = (37 * hash) + CLIENTCONFIG_FIELD_NUMBER; - hash = (53 * hash) + getClientConfig().hashCode(); - } - if (getRulesCount() > 0) { - hash = (37 * hash) + RULES_FIELD_NUMBER; - hash = (53 * hash) + getRulesList().hashCode(); - } - if (hasFailurePolicy()) { - hash = (37 * hash) + FAILUREPOLICY_FIELD_NUMBER; - hash = (53 * hash) + getFailurePolicy().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * ExternalAdmissionHook describes an external admission webhook and the
-     * resources and operations it applies to.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getClientConfigFieldBuilder(); - getRulesFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - name_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - if (clientConfigBuilder_ == null) { - clientConfig_ = null; - } else { - clientConfigBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - rulesBuilder_.clear(); - } - failurePolicy_ = ""; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook( - this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (clientConfigBuilder_ == null) { - result.clientConfig_ = clientConfig_; - } else { - result.clientConfig_ = clientConfigBuilder_.build(); - } - if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.rules_ = rules_; - } else { - result.rules_ = rulesBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.failurePolicy_ = failurePolicy_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .getDefaultInstance()) return this; - if (other.hasName()) { - bitField0_ |= 0x00000001; - name_ = other.name_; - onChanged(); - } - if (other.hasClientConfig()) { - mergeClientConfig(other.getClientConfig()); - } - if (rulesBuilder_ == null) { - if (!other.rules_.isEmpty()) { - if (rules_.isEmpty()) { - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureRulesIsMutable(); - rules_.addAll(other.rules_); - } - onChanged(); - } - } else { - if (!other.rules_.isEmpty()) { - if (rulesBuilder_.isEmpty()) { - rulesBuilder_.dispose(); - rulesBuilder_ = null; - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000004); - rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() - : null; - } else { - rulesBuilder_.addAllMessages(other.rules_); - } - } - } - if (other.hasFailurePolicy()) { - bitField0_ |= 0x00000008; - failurePolicy_ = other.failurePolicy_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * The name of the external admission webhook.
-       * Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
-       * "imagepolicy" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required.
-       * 
- * - * optional string name = 1; - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - - private io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - clientConfig_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig, - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder> - clientConfigBuilder_; - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public boolean hasClientConfig() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - getClientConfig() { - if (clientConfigBuilder_ == null) { - return clientConfig_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance() - : clientConfig_; - } else { - return clientConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public Builder setClientConfig( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - value) { - if (clientConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - clientConfig_ = value; - onChanged(); - } else { - clientConfigBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public Builder setClientConfig( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig.Builder - builderForValue) { - if (clientConfigBuilder_ == null) { - clientConfig_ = builderForValue.build(); - onChanged(); - } else { - clientConfigBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public Builder mergeClientConfig( - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - value) { - if (clientConfigBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && clientConfig_ != null - && clientConfig_ - != io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfig.getDefaultInstance()) { - clientConfig_ = - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .newBuilder(clientConfig_) - .mergeFrom(value) - .buildPartial(); - } else { - clientConfig_ = value; - } - onChanged(); - } else { - clientConfigBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public Builder clearClientConfig() { - if (clientConfigBuilder_ == null) { - clientConfig_ = null; - onChanged(); - } else { - clientConfigBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder - getClientConfigBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getClientConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder - getClientConfigOrBuilder() { - if (clientConfigBuilder_ != null) { - return clientConfigBuilder_.getMessageOrBuilder(); - } else { - return clientConfig_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .getDefaultInstance() - : clientConfig_; - } - } - /** - * - * - *
-       * ClientConfig defines how to communicate with the hook.
-       * Required
-       * 
- * - * - * optional .k8s.io.api.admissionregistration.v1alpha1.AdmissionHookClientConfig clientConfig = 2; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig, - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder> - getClientConfigFieldBuilder() { - if (clientConfigBuilder_ == null) { - clientConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfig, - io.kubernetes.client.proto.V1alpha1Admissionregistration.AdmissionHookClientConfig - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .AdmissionHookClientConfigOrBuilder>( - getClientConfig(), getParentForChildren(), isClean()); - clientConfig_ = null; - } - return clientConfigBuilder_; - } - - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> - rules_ = java.util.Collections.emptyList(); - - private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - rules_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations>( - rules_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder> - rulesBuilder_; - - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> - getRulesList() { - if (rulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(rules_); - } else { - return rulesBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public int getRulesCount() { - if (rulesBuilder_ == null) { - return rules_.size(); - } else { - return rulesBuilder_.getCount(); - } - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations getRules( - int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); - } else { - return rulesBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder setRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.set(index, value); - onChanged(); - } else { - rulesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder setRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.set(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder addRules( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(value); - onChanged(); - } else { - rulesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder addRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(index, value); - onChanged(); - } else { - rulesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder addRules( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder addRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder addAllRules( - java.lang.Iterable< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations> - values) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); - onChanged(); - } else { - rulesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder clearRules() { - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - rulesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public Builder removeRules(int index) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.remove(index); - onChanged(); - } else { - rulesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder - getRulesOrBuilder(int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); - } else { - return rulesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .RuleWithOperationsOrBuilder> - getRulesOrBuilderList() { - if (rulesBuilder_ != null) { - return rulesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rules_); - } - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - addRulesBuilder() { - return getRulesFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .getDefaultInstance()); - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - addRulesBuilder(int index) { - return getRulesFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .getDefaultInstance()); - } - /** - * - * - *
-       * Rules describes what operations on what resources/subresources the webhook cares about.
-       * The webhook cares about an operation if it matches _any_ Rule.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations rules = 3; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder> - getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder> - getRulesFieldBuilder() { - if (rulesBuilder_ == null) { - rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .RuleWithOperationsOrBuilder>( - rules_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - rules_ = null; - } - return rulesBuilder_; - } - - private java.lang.Object failurePolicy_ = ""; - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public boolean hasFailurePolicy() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public java.lang.String getFailurePolicy() { - java.lang.Object ref = failurePolicy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - failurePolicy_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public com.google.protobuf.ByteString getFailurePolicyBytes() { - java.lang.Object ref = failurePolicy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - failurePolicy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public Builder setFailurePolicy(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - failurePolicy_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public Builder clearFailurePolicy() { - bitField0_ = (bitField0_ & ~0x00000008); - failurePolicy_ = getDefaultInstance().getFailurePolicy(); - onChanged(); - return this; - } - /** - * - * - *
-       * FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
-       * allowed values are Ignore or Fail. Defaults to Ignore.
-       * +optional
-       * 
- * - * optional string failurePolicy = 4; - */ - public Builder setFailurePolicyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - failurePolicy_ = value; - onChanged(); - return this; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHook - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ExternalAdmissionHook parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExternalAdmissionHook(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ExternalAdmissionHookConfigurationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - java.util.List - getExternalAdmissionHooksList(); - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getExternalAdmissionHooks(int index); - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - int getExternalAdmissionHooksCount(); - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder> - getExternalAdmissionHooksOrBuilderList(); - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder - getExternalAdmissionHooksOrBuilder(int index); - } - /** - * - * - *
-   * ExternalAdmissionHookConfiguration describes the configuration of initializers.
-   * 
- * - * Protobuf type {@code - * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration} - */ - public static final class ExternalAdmissionHookConfiguration - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) - ExternalAdmissionHookConfigurationOrBuilder { - private static final long serialVersionUID = 0L; - // Use ExternalAdmissionHookConfiguration.newBuilder() to construct. - private ExternalAdmissionHookConfiguration( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ExternalAdmissionHookConfiguration() { - externalAdmissionHooks_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ExternalAdmissionHookConfiguration( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - externalAdmissionHooks_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHook>(); - mutable_bitField0_ |= 0x00000002; - } - externalAdmissionHooks_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHook.PARSER, - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - externalAdmissionHooks_ = java.util.Collections.unmodifiableList(externalAdmissionHooks_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int EXTERNALADMISSIONHOOKS_FIELD_NUMBER = 2; - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> - externalAdmissionHooks_; - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> - getExternalAdmissionHooksList() { - return externalAdmissionHooks_; - } - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder> - getExternalAdmissionHooksOrBuilderList() { - return externalAdmissionHooks_; - } - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public int getExternalAdmissionHooksCount() { - return externalAdmissionHooks_.size(); - } - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getExternalAdmissionHooks(int index) { - return externalAdmissionHooks_.get(index); - } - /** - * - * - *
-     * ExternalAdmissionHooks is a list of external admission webhooks and the
-     * affected resources and operations.
-     * +optional
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder - getExternalAdmissionHooksOrBuilder(int index) { - return externalAdmissionHooks_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < externalAdmissionHooks_.size(); i++) { - output.writeMessage(2, externalAdmissionHooks_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < externalAdmissionHooks_.size(); i++) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, externalAdmissionHooks_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration) - obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = - result && getExternalAdmissionHooksList().equals(other.getExternalAdmissionHooksList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getExternalAdmissionHooksCount() > 0) { - hash = (37 * hash) + EXTERNALADMISSIONHOOKS_FIELD_NUMBER; - hash = (53 * hash) + getExternalAdmissionHooksList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * ExternalAdmissionHookConfiguration describes the configuration of initializers.
-     * 
- * - * Protobuf type {@code - * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getExternalAdmissionHooksFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (externalAdmissionHooksBuilder_ == null) { - externalAdmissionHooks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - externalAdmissionHooksBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (externalAdmissionHooksBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - externalAdmissionHooks_ = - java.util.Collections.unmodifiableList(externalAdmissionHooks_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.externalAdmissionHooks_ = externalAdmissionHooks_; - } else { - result.externalAdmissionHooks_ = externalAdmissionHooksBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.getDefaultInstance()) return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (externalAdmissionHooksBuilder_ == null) { - if (!other.externalAdmissionHooks_.isEmpty()) { - if (externalAdmissionHooks_.isEmpty()) { - externalAdmissionHooks_ = other.externalAdmissionHooks_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.addAll(other.externalAdmissionHooks_); - } - onChanged(); - } - } else { - if (!other.externalAdmissionHooks_.isEmpty()) { - if (externalAdmissionHooksBuilder_.isEmpty()) { - externalAdmissionHooksBuilder_.dispose(); - externalAdmissionHooksBuilder_ = null; - externalAdmissionHooks_ = other.externalAdmissionHooks_; - bitField0_ = (bitField0_ & ~0x00000002); - externalAdmissionHooksBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getExternalAdmissionHooksFieldBuilder() - : null; - } else { - externalAdmissionHooksBuilder_.addAllMessages(other.externalAdmissionHooks_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> - externalAdmissionHooks_ = java.util.Collections.emptyList(); - - private void ensureExternalAdmissionHooksIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - externalAdmissionHooks_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook>( - externalAdmissionHooks_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder> - externalAdmissionHooksBuilder_; - - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook> - getExternalAdmissionHooksList() { - if (externalAdmissionHooksBuilder_ == null) { - return java.util.Collections.unmodifiableList(externalAdmissionHooks_); - } else { - return externalAdmissionHooksBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public int getExternalAdmissionHooksCount() { - if (externalAdmissionHooksBuilder_ == null) { - return externalAdmissionHooks_.size(); - } else { - return externalAdmissionHooksBuilder_.getCount(); - } - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - getExternalAdmissionHooks(int index) { - if (externalAdmissionHooksBuilder_ == null) { - return externalAdmissionHooks_.get(index); - } else { - return externalAdmissionHooksBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder setExternalAdmissionHooks( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { - if (externalAdmissionHooksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.set(index, value); - onChanged(); - } else { - externalAdmissionHooksBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder setExternalAdmissionHooks( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - builderForValue) { - if (externalAdmissionHooksBuilder_ == null) { - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.set(index, builderForValue.build()); - onChanged(); - } else { - externalAdmissionHooksBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder addExternalAdmissionHooks( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { - if (externalAdmissionHooksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.add(value); - onChanged(); - } else { - externalAdmissionHooksBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder addExternalAdmissionHooks( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook value) { - if (externalAdmissionHooksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.add(index, value); - onChanged(); - } else { - externalAdmissionHooksBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder addExternalAdmissionHooks( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - builderForValue) { - if (externalAdmissionHooksBuilder_ == null) { - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.add(builderForValue.build()); - onChanged(); - } else { - externalAdmissionHooksBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder addExternalAdmissionHooks( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - builderForValue) { - if (externalAdmissionHooksBuilder_ == null) { - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.add(index, builderForValue.build()); - onChanged(); - } else { - externalAdmissionHooksBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder addAllExternalAdmissionHooks( - java.lang.Iterable< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHook> - values) { - if (externalAdmissionHooksBuilder_ == null) { - ensureExternalAdmissionHooksIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, externalAdmissionHooks_); - onChanged(); - } else { - externalAdmissionHooksBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder clearExternalAdmissionHooks() { - if (externalAdmissionHooksBuilder_ == null) { - externalAdmissionHooks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - externalAdmissionHooksBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public Builder removeExternalAdmissionHooks(int index) { - if (externalAdmissionHooksBuilder_ == null) { - ensureExternalAdmissionHooksIsMutable(); - externalAdmissionHooks_.remove(index); - onChanged(); - } else { - externalAdmissionHooksBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - getExternalAdmissionHooksBuilder(int index) { - return getExternalAdmissionHooksFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookOrBuilder - getExternalAdmissionHooksOrBuilder(int index) { - if (externalAdmissionHooksBuilder_ == null) { - return externalAdmissionHooks_.get(index); - } else { - return externalAdmissionHooksBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder> - getExternalAdmissionHooksOrBuilderList() { - if (externalAdmissionHooksBuilder_ != null) { - return externalAdmissionHooksBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(externalAdmissionHooks_); - } - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - addExternalAdmissionHooksBuilder() { - return getExternalAdmissionHooksFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .getDefaultInstance()); - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook.Builder - addExternalAdmissionHooksBuilder(int index) { - return getExternalAdmissionHooksFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .getDefaultInstance()); - } - /** - * - * - *
-       * ExternalAdmissionHooks is a list of external admission webhooks and the
-       * affected resources and operations.
-       * +optional
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHook externalAdmissionHooks = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .Builder> - getExternalAdmissionHooksBuilderList() { - return getExternalAdmissionHooksFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder> - getExternalAdmissionHooksFieldBuilder() { - if (externalAdmissionHooksBuilder_ == null) { - externalAdmissionHooksBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHook - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookOrBuilder>( - externalAdmissionHooks_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - externalAdmissionHooks_ = null; - } - return externalAdmissionHooksBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ExternalAdmissionHookConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExternalAdmissionHookConfiguration(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ExternalAdmissionHookConfigurationListOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMeta getMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - getItemsList(); - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfiguration - getItems(int index); - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - int getItemsCount(); - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder> - getItemsOrBuilderList(); - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder - getItemsOrBuilder(int index); - } - /** - * - * - *
-   * ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration.
-   * 
- * - * Protobuf type {@code - * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList} - */ - public static final class ExternalAdmissionHookConfigurationList - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) - ExternalAdmissionHookConfigurationListOrBuilder { - private static final long serialVersionUID = 0L; - // Use ExternalAdmissionHookConfigurationList.newBuilder() to construct. - private ExternalAdmissionHookConfigurationList( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ExternalAdmissionHookConfigurationList() { - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ExternalAdmissionHookConfigurationList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration>(); - mutable_bitField0_ |= 0x00000002; - } - items_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.PARSER, - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ListMeta metadata_; - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - - public static final int ITEMS_FIELD_NUMBER = 2; - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - items_; - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - getItemsList() { - return items_; - } - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder> - getItemsOrBuilderList() { - return items_; - } - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public int getItemsCount() { - return items_.size(); - } - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - getItems(int index) { - return items_.get(index); - } - /** - * - * - *
-     * List of ExternalAdmissionHookConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder - getItemsOrBuilder(int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(2, items_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList) - obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && getItemsList().equals(other.getItemsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration.
-     * 
- * - * Protobuf type {@code - * k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.ExternalAdmissionHookConfigurationList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getItemsFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - itemsBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList.getDefaultInstance()) return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getItemsFieldBuilder() - : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - items_ = java.util.Collections.emptyList(); - - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration>(items_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder> - itemsBuilder_; - - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder setItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder setItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder addItems( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder addItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration - value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder addItems( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder addItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder addAllItems( - java.lang.Iterable< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration> - values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - getItemsBuilder(int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder - getItemsOrBuilder(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder> - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - addItemsBuilder() { - return getItemsFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.getDefaultInstance()); - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder - addItemsBuilder(int index) { - return getItemsFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.getDefaultInstance()); - } - /** - * - * - *
-       * List of ExternalAdmissionHookConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder> - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfiguration.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationOrBuilder>( - items_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ExternalAdmissionHookConfigurationList) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ExternalAdmissionHookConfigurationList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExternalAdmissionHookConfigurationList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .ExternalAdmissionHookConfigurationList - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface InitializerOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.Initializer) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - boolean hasName(); - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - java.lang.String getName(); - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - java.util.List getRulesList(); - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index); - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - int getRulesCount(); - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - java.util.List - getRulesOrBuilderList(); - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRulesOrBuilder( - int index); - } - /** - * - * - *
-   * Initializer describes the name and the failure policy of an initializer, and
-   * what resources it applies to.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Initializer} - */ - public static final class Initializer extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.Initializer) - InitializerOrBuilder { - private static final long serialVersionUID = 0L; - // Use Initializer.newBuilder() to construct. - private Initializer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Initializer() { - name_ = ""; - rules_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Initializer( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - name_ = bs; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - rules_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule>(); - mutable_bitField0_ |= 0x00000002; - } - rules_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.PARSER, - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } - } - /** - * - * - *
-     * Name is the identifier of the initializer. It will be added to the
-     * object that needs to be initialized.
-     * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-     * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-     * of the organization.
-     * Required
-     * 
- * - * optional string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RULES_FIELD_NUMBER = 2; - private java.util.List rules_; - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public java.util.List - getRulesList() { - return rules_; - } - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public java.util.List< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - getRulesOrBuilderList() { - return rules_; - } - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public int getRulesCount() { - return rules_.size(); - } - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index) { - return rules_.get(index); - } - /** - * - * - *
-     * Rules describes what resources/subresources the initializer cares about.
-     * The initializer cares about an operation if it matches _any_ Rule.
-     * Rule.Resources must not include subresources.
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRulesOrBuilder( - int index) { - return rules_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < rules_.size(); i++) { - output.writeMessage(2, rules_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - for (int i = 0; i < rules_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rules_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) obj; - - boolean result = true; - result = result && (hasName() == other.hasName()); - if (hasName()) { - result = result && getName().equals(other.getName()); - } - result = result && getRulesList().equals(other.getRulesList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasName()) { - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - } - if (getRulesCount() > 0) { - hash = (37 * hash) + RULES_FIELD_NUMBER; - hash = (53 * hash) + getRulesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Initializer describes the name and the failure policy of an initializer, and
-     * what resources it applies to.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Initializer} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.Initializer) - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getRulesFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - name_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - rulesBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.rules_ = rules_; - } else { - result.rules_ = rulesBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - .getDefaultInstance()) return this; - if (other.hasName()) { - bitField0_ |= 0x00000001; - name_ = other.name_; - onChanged(); - } - if (rulesBuilder_ == null) { - if (!other.rules_.isEmpty()) { - if (rules_.isEmpty()) { - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureRulesIsMutable(); - rules_.addAll(other.rules_); - } - onChanged(); - } - } else { - if (!other.rules_.isEmpty()) { - if (rulesBuilder_.isEmpty()) { - rulesBuilder_.dispose(); - rulesBuilder_ = null; - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); - rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() - : null; - } else { - rulesBuilder_.addAllMessages(other.rules_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the identifier of the initializer. It will be added to the
-       * object that needs to be initialized.
-       * Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where
-       * "alwayspullimages" is the name of the webhook, and kubernetes.io is the name
-       * of the organization.
-       * Required
-       * 
- * - * optional string name = 1; - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - - private java.util.List rules_ = - java.util.Collections.emptyList(); - - private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - rules_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule>(rules_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - rulesBuilder_; - - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public java.util.List - getRulesList() { - if (rulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(rules_); - } else { - return rulesBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public int getRulesCount() { - if (rulesBuilder_ == null) { - return rules_.size(); - } else { - return rulesBuilder_.getCount(); - } - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRules(int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); - } else { - return rulesBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder setRules( - int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.set(index, value); - onChanged(); - } else { - rulesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder setRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.set(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder addRules(io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(value); - onChanged(); - } else { - rulesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder addRules( - int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(index, value); - onChanged(); - } else { - rulesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder addRules( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder addRules( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder addAllRules( - java.lang.Iterable< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule> - values) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); - onChanged(); - } else { - rulesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder clearRules() { - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - rulesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public Builder removeRules(int index) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.remove(index); - onChanged(); - } else { - rulesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder getRulesBuilder( - int index) { - return getRulesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder - getRulesOrBuilder(int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); - } else { - return rulesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public java.util.List< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - getRulesOrBuilderList() { - if (rulesBuilder_ != null) { - return rulesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rules_); - } - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder - addRulesBuilder() { - return getRulesFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()); - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder addRulesBuilder( - int index) { - return getRulesFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()); - } - /** - * - * - *
-       * Rules describes what resources/subresources the initializer cares about.
-       * The initializer cares about an operation if it matches _any_ Rule.
-       * Rule.Resources must not include subresources.
-       * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Rule rules = 2; - */ - public java.util.List - getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - getRulesFieldBuilder() { - if (rulesBuilder_ == null) { - rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder>( - rules_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - rules_ = null; - } - return rulesBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.Initializer) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.Initializer) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Initializer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Initializer(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface InitializerConfigurationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - java.util.List - getInitializersList(); - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers(int index); - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - int getInitializersCount(); - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - java.util.List< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> - getInitializersOrBuilderList(); - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder - getInitializersOrBuilder(int index); - } - /** - * - * - *
-   * InitializerConfiguration describes the configuration of initializers.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration} - */ - public static final class InitializerConfiguration extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) - InitializerConfigurationOrBuilder { - private static final long serialVersionUID = 0L; - // Use InitializerConfiguration.newBuilder() to construct. - private InitializerConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private InitializerConfiguration() { - initializers_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private InitializerConfiguration( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - initializers_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer>(); - mutable_bitField0_ |= 0x00000002; - } - initializers_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.PARSER, - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - initializers_ = java.util.Collections.unmodifiableList(initializers_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int INITIALIZERS_FIELD_NUMBER = 2; - private java.util.List - initializers_; - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public java.util.List - getInitializersList() { - return initializers_; - } - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public java.util.List< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> - getInitializersOrBuilderList() { - return initializers_; - } - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public int getInitializersCount() { - return initializers_.size(); - } - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers( - int index) { - return initializers_.get(index); - } - /** - * - * - *
-     * Initializers is a list of resources and their default initializers
-     * Order-sensitive.
-     * When merging multiple InitializerConfigurations, we sort the initializers
-     * from different InitializerConfigurations by the name of the
-     * InitializerConfigurations; the order of the initializers from the same
-     * InitializerConfiguration is preserved.
-     * +patchMergeKey=name
-     * +patchStrategy=merge
-     * +optional
-     * 
- * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder - getInitializersOrBuilder(int index) { - return initializers_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < initializers_.size(); i++) { - output.writeMessage(2, initializers_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < initializers_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, initializers_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && getInitializersList().equals(other.getInitializersList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getInitializersCount() > 0) { - hash = (37 * hash) + INITIALIZERS_FIELD_NUMBER; - hash = (53 * hash) + getInitializersList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * InitializerConfiguration describes the configuration of initializers.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getInitializersFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (initializersBuilder_ == null) { - initializers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - initializersBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration( - this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (initializersBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - initializers_ = java.util.Collections.unmodifiableList(initializers_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.initializers_ = initializers_; - } else { - result.initializers_ = initializersBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .getDefaultInstance()) return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (initializersBuilder_ == null) { - if (!other.initializers_.isEmpty()) { - if (initializers_.isEmpty()) { - initializers_ = other.initializers_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInitializersIsMutable(); - initializers_.addAll(other.initializers_); - } - onChanged(); - } - } else { - if (!other.initializers_.isEmpty()) { - if (initializersBuilder_.isEmpty()) { - initializersBuilder_.dispose(); - initializersBuilder_ = null; - initializers_ = other.initializers_; - bitField0_ = (bitField0_ & ~0x00000002); - initializersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getInitializersFieldBuilder() - : null; - } else { - initializersBuilder_.addAllMessages(other.initializers_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List - initializers_ = java.util.Collections.emptyList(); - - private void ensureInitializersIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - initializers_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer>( - initializers_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> - initializersBuilder_; - - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public java.util.List - getInitializersList() { - if (initializersBuilder_ == null) { - return java.util.Collections.unmodifiableList(initializers_); - } else { - return initializersBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public int getInitializersCount() { - if (initializersBuilder_ == null) { - return initializers_.size(); - } else { - return initializersBuilder_.getCount(); - } - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer getInitializers( - int index) { - if (initializersBuilder_ == null) { - return initializers_.get(index); - } else { - return initializersBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder setInitializers( - int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { - if (initializersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInitializersIsMutable(); - initializers_.set(index, value); - onChanged(); - } else { - initializersBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder setInitializers( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - builderForValue) { - if (initializersBuilder_ == null) { - ensureInitializersIsMutable(); - initializers_.set(index, builderForValue.build()); - onChanged(); - } else { - initializersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder addInitializers( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { - if (initializersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInitializersIsMutable(); - initializers_.add(value); - onChanged(); - } else { - initializersBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder addInitializers( - int index, io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer value) { - if (initializersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInitializersIsMutable(); - initializers_.add(index, value); - onChanged(); - } else { - initializersBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder addInitializers( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - builderForValue) { - if (initializersBuilder_ == null) { - ensureInitializersIsMutable(); - initializers_.add(builderForValue.build()); - onChanged(); - } else { - initializersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder addInitializers( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - builderForValue) { - if (initializersBuilder_ == null) { - ensureInitializersIsMutable(); - initializers_.add(index, builderForValue.build()); - onChanged(); - } else { - initializersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder addAllInitializers( - java.lang.Iterable< - ? extends io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer> - values) { - if (initializersBuilder_ == null) { - ensureInitializersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, initializers_); - onChanged(); - } else { - initializersBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder clearInitializers() { - if (initializersBuilder_ == null) { - initializers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - initializersBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public Builder removeInitializers(int index) { - if (initializersBuilder_ == null) { - ensureInitializersIsMutable(); - initializers_.remove(index); - onChanged(); - } else { - initializersBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - getInitializersBuilder(int index) { - return getInitializersFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder - getInitializersOrBuilder(int index) { - if (initializersBuilder_ == null) { - return initializers_.get(index); - } else { - return initializersBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> - getInitializersOrBuilderList() { - if (initializersBuilder_ != null) { - return initializersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(initializers_); - } - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - addInitializersBuilder() { - return getInitializersFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - .getDefaultInstance()); - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder - addInitializersBuilder(int index) { - return getInitializersFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer - .getDefaultInstance()); - } - /** - * - * - *
-       * Initializers is a list of resources and their default initializers
-       * Order-sensitive.
-       * When merging multiple InitializerConfigurations, we sort the initializers
-       * from different InitializerConfigurations by the name of the
-       * InitializerConfigurations; the order of the initializers from the same
-       * InitializerConfiguration is preserved.
-       * +patchMergeKey=name
-       * +patchStrategy=merge
-       * +optional
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.Initializer initializers = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder> - getInitializersBuilderList() { - return getInitializersFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder> - getInitializersFieldBuilder() { - if (initializersBuilder_ == null) { - initializersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Initializer.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerOrBuilder>( - initializers_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - initializers_ = null; - } - return initializersBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfiguration - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public InitializerConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new InitializerConfiguration(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface InitializerConfigurationListOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMeta getMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> - getItemsList(); - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration getItems( - int index); - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - int getItemsCount(); - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder> - getItemsOrBuilderList(); - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationOrBuilder - getItemsOrBuilder(int index); - } - /** - * - * - *
-   * InitializerConfigurationList is a list of InitializerConfiguration.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList} - */ - public static final class InitializerConfigurationList - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) - InitializerConfigurationListOrBuilder { - private static final long serialVersionUID = 0L; - // Use InitializerConfigurationList.newBuilder() to construct. - private InitializerConfigurationList( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private InitializerConfigurationList() { - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private InitializerConfigurationList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfiguration>(); - mutable_bitField0_ |= 0x00000002; - } - items_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfiguration.PARSER, - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - .class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - .Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ListMeta metadata_; - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - - public static final int ITEMS_FIELD_NUMBER = 2; - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> - items_; - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> - getItemsList() { - return items_; - } - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder> - getItemsOrBuilderList() { - return items_; - } - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public int getItemsCount() { - return items_.size(); - } - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - getItems(int index) { - return items_.get(index); - } - /** - * - * - *
-     * List of InitializerConfiguration.
-     * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder - getItemsOrBuilder(int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(2, items_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList) - obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && getItemsList().equals(other.getItemsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * InitializerConfigurationList is a list of InitializerConfiguration.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getItemsFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - itemsBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - .getDefaultInstance()) return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getItemsFieldBuilder() - : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> - items_ = java.util.Collections.emptyList(); - - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfiguration>(items_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder> - itemsBuilder_; - - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration> - getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder setItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder setItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder addItems( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder addItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder addItems( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder addItems( - int index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration.Builder - builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder addAllItems( - java.lang.Iterable< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfiguration> - values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder - getItemsBuilder(int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder - getItemsOrBuilder(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public java.util.List< - ? extends - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder> - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder - addItemsBuilder() { - return getItemsFieldBuilder() - .addBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .getDefaultInstance()); - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder - addItemsBuilder(int index) { - return getItemsFieldBuilder() - .addBuilder( - index, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .getDefaultInstance()); - } - /** - * - * - *
-       * List of InitializerConfiguration.
-       * 
- * - * - * repeated .k8s.io.api.admissionregistration.v1alpha1.InitializerConfiguration items = 2; - * - */ - public java.util.List< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder> - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration, - io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfiguration - .Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationOrBuilder>( - items_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.InitializerConfigurationList) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration - .InitializerConfigurationList - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public InitializerConfigurationList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new InitializerConfigurationList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.InitializerConfigurationList - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface RuleOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.Rule) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - java.util.List getApiGroupsList(); - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - int getApiGroupsCount(); - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - java.lang.String getApiGroups(int index); - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - com.google.protobuf.ByteString getApiGroupsBytes(int index); - - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - java.util.List getApiVersionsList(); - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - int getApiVersionsCount(); - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - java.lang.String getApiVersions(int index); - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - com.google.protobuf.ByteString getApiVersionsBytes(int index); - - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - java.util.List getResourcesList(); - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - int getResourcesCount(); - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - java.lang.String getResources(int index); - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - com.google.protobuf.ByteString getResourcesBytes(int index); - } - /** - * - * - *
-   * Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
-   * to make sure that all the tuple expansions are valid.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Rule} - */ - public static final class Rule extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.Rule) - RuleOrBuilder { - private static final long serialVersionUID = 0L; - // Use Rule.newBuilder() to construct. - private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Rule() { - apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; - apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Rule( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - apiGroups_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - apiGroups_.add(bs); - break; - } - case 18: - { - com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - apiVersions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - apiVersions_.add(bs); - break; - } - case 26: - { - com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - resources_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - resources_.add(bs); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - apiGroups_ = apiGroups_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - apiVersions_ = apiVersions_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - resources_ = resources_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder.class); - } - - public static final int APIGROUPS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList apiGroups_; - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - public com.google.protobuf.ProtocolStringList getApiGroupsList() { - return apiGroups_; - } - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - public int getApiGroupsCount() { - return apiGroups_.size(); - } - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - public java.lang.String getApiGroups(int index) { - return apiGroups_.get(index); - } - /** - * - * - *
-     * APIGroups is the API groups the resources belong to. '*' is all groups.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiGroups = 1; - */ - public com.google.protobuf.ByteString getApiGroupsBytes(int index) { - return apiGroups_.getByteString(index); - } - - public static final int APIVERSIONS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList apiVersions_; - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - public com.google.protobuf.ProtocolStringList getApiVersionsList() { - return apiVersions_; - } - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - public int getApiVersionsCount() { - return apiVersions_.size(); - } - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - public java.lang.String getApiVersions(int index) { - return apiVersions_.get(index); - } - /** - * - * - *
-     * APIVersions is the API versions the resources belong to. '*' is all versions.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string apiVersions = 2; - */ - public com.google.protobuf.ByteString getApiVersionsBytes(int index) { - return apiVersions_.getByteString(index); - } - - public static final int RESOURCES_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList resources_; - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - public com.google.protobuf.ProtocolStringList getResourcesList() { - return resources_; - } - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - public int getResourcesCount() { - return resources_.size(); - } - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - public java.lang.String getResources(int index) { - return resources_.get(index); - } - /** - * - * - *
-     * Resources is a list of resources this rule applies to.
-     *
-     * For example:
-     * 'pods' means pods.
-     * 'pods/log' means the log subresource of pods.
-     * '*' means all resources, but not subresources.
-     * 'pods/*' means all subresources of pods.
-     * '*/scale' means all scale subresources.
-     * '*/*' means all resources and their subresources.
-     *
-     * If wildcard is present, the validation rule will ensure resources do not
-     * overlap with each other.
-     *
-     * Depending on the enclosing object, subresources might not be allowed.
-     * Required.
-     * 
- * - * repeated string resources = 3; - */ - public com.google.protobuf.ByteString getResourcesBytes(int index) { - return resources_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < apiGroups_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, apiGroups_.getRaw(i)); - } - for (int i = 0; i < apiVersions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, apiVersions_.getRaw(i)); - } - for (int i = 0; i < resources_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resources_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < apiGroups_.size(); i++) { - dataSize += computeStringSizeNoTag(apiGroups_.getRaw(i)); - } - size += dataSize; - size += 1 * getApiGroupsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < apiVersions_.size(); i++) { - dataSize += computeStringSizeNoTag(apiVersions_.getRaw(i)); - } - size += dataSize; - size += 1 * getApiVersionsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < resources_.size(); i++) { - dataSize += computeStringSizeNoTag(resources_.getRaw(i)); - } - size += dataSize; - size += 1 * getResourcesList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) obj; - - boolean result = true; - result = result && getApiGroupsList().equals(other.getApiGroupsList()); - result = result && getApiVersionsList().equals(other.getApiVersionsList()); - result = result && getResourcesList().equals(other.getResourcesList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getApiGroupsCount() > 0) { - hash = (37 * hash) + APIGROUPS_FIELD_NUMBER; - hash = (53 * hash) + getApiGroupsList().hashCode(); - } - if (getApiVersionsCount() > 0) { - hash = (37 * hash) + APIVERSIONS_FIELD_NUMBER; - hash = (53 * hash) + getApiVersionsList().hashCode(); - } - if (getResourcesCount() > 0) { - hash = (37 * hash) + RESOURCES_FIELD_NUMBER; - hash = (53 * hash) + getResourcesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
-     * to make sure that all the tuple expansions are valid.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.Rule} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.Rule) - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - apiGroups_ = apiGroups_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.apiGroups_ = apiGroups_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - apiVersions_ = apiVersions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.apiVersions_ = apiVersions_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - resources_ = resources_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.resources_ = resources_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) { - return mergeFrom((io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance()) - return this; - if (!other.apiGroups_.isEmpty()) { - if (apiGroups_.isEmpty()) { - apiGroups_ = other.apiGroups_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureApiGroupsIsMutable(); - apiGroups_.addAll(other.apiGroups_); - } - onChanged(); - } - if (!other.apiVersions_.isEmpty()) { - if (apiVersions_.isEmpty()) { - apiVersions_ = other.apiVersions_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureApiVersionsIsMutable(); - apiVersions_.addAll(other.apiVersions_); - } - onChanged(); - } - if (!other.resources_.isEmpty()) { - if (resources_.isEmpty()) { - resources_ = other.resources_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureResourcesIsMutable(); - resources_.addAll(other.resources_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList apiGroups_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureApiGroupsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - apiGroups_ = new com.google.protobuf.LazyStringArrayList(apiGroups_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public com.google.protobuf.ProtocolStringList getApiGroupsList() { - return apiGroups_.getUnmodifiableView(); - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public int getApiGroupsCount() { - return apiGroups_.size(); - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public java.lang.String getApiGroups(int index) { - return apiGroups_.get(index); - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public com.google.protobuf.ByteString getApiGroupsBytes(int index) { - return apiGroups_.getByteString(index); - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public Builder setApiGroups(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiGroupsIsMutable(); - apiGroups_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public Builder addApiGroups(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiGroupsIsMutable(); - apiGroups_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public Builder addAllApiGroups(java.lang.Iterable values) { - ensureApiGroupsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiGroups_); - onChanged(); - return this; - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public Builder clearApiGroups() { - apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * APIGroups is the API groups the resources belong to. '*' is all groups.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiGroups = 1; - */ - public Builder addApiGroupsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiGroupsIsMutable(); - apiGroups_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList apiVersions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureApiVersionsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - apiVersions_ = new com.google.protobuf.LazyStringArrayList(apiVersions_); - bitField0_ |= 0x00000002; - } - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public com.google.protobuf.ProtocolStringList getApiVersionsList() { - return apiVersions_.getUnmodifiableView(); - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public int getApiVersionsCount() { - return apiVersions_.size(); - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public java.lang.String getApiVersions(int index) { - return apiVersions_.get(index); - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public com.google.protobuf.ByteString getApiVersionsBytes(int index) { - return apiVersions_.getByteString(index); - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public Builder setApiVersions(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiVersionsIsMutable(); - apiVersions_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public Builder addApiVersions(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiVersionsIsMutable(); - apiVersions_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public Builder addAllApiVersions(java.lang.Iterable values) { - ensureApiVersionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, apiVersions_); - onChanged(); - return this; - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public Builder clearApiVersions() { - apiVersions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-       * APIVersions is the API versions the resources belong to. '*' is all versions.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string apiVersions = 2; - */ - public Builder addApiVersionsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureApiVersionsIsMutable(); - apiVersions_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList resources_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureResourcesIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - resources_ = new com.google.protobuf.LazyStringArrayList(resources_); - bitField0_ |= 0x00000004; - } - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public com.google.protobuf.ProtocolStringList getResourcesList() { - return resources_.getUnmodifiableView(); - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public int getResourcesCount() { - return resources_.size(); - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public java.lang.String getResources(int index) { - return resources_.get(index); - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public com.google.protobuf.ByteString getResourcesBytes(int index) { - return resources_.getByteString(index); - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public Builder setResources(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public Builder addResources(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public Builder addAllResources(java.lang.Iterable values) { - ensureResourcesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); - onChanged(); - return this; - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public Builder clearResources() { - resources_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-       * Resources is a list of resources this rule applies to.
-       *
-       * For example:
-       * 'pods' means pods.
-       * 'pods/log' means the log subresource of pods.
-       * '*' means all resources, but not subresources.
-       * 'pods/*' means all subresources of pods.
-       * '*/scale' means all scale subresources.
-       * '*/*' means all resources and their subresources.
-       *
-       * If wildcard is present, the validation rule will ensure resources do not
-       * overlap with each other.
-       *
-       * Depending on the enclosing object, subresources might not be allowed.
-       * Required.
-       * 
- * - * repeated string resources = 3; - */ - public Builder addResourcesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(value); - onChanged(); - return this; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.Rule) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.Rule) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Rule parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Rule(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface RuleWithOperationsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - java.util.List getOperationsList(); - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - int getOperationsCount(); - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - java.lang.String getOperations(int index); - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - com.google.protobuf.ByteString getOperationsBytes(int index); - - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - boolean hasRule(); - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule(); - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder getRuleOrBuilder(); - } - /** - * - * - *
-   * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
-   * sure that all the tuple expansions are valid.
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations} - */ - public static final class RuleWithOperations extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) - RuleWithOperationsOrBuilder { - private static final long serialVersionUID = 0L; - // Use RuleWithOperations.newBuilder() to construct. - private RuleWithOperations(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RuleWithOperations() { - operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RuleWithOperations( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - operations_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - operations_.add(bs); - break; - } - case 18: - { - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder subBuilder = - null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = rule_.toBuilder(); - } - rule_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rule_); - rule_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - operations_ = operations_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - .class); - } - - private int bitField0_; - public static final int OPERATIONS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList operations_; - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - public com.google.protobuf.ProtocolStringList getOperationsList() { - return operations_; - } - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - public int getOperationsCount() { - return operations_.size(); - } - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - public java.lang.String getOperations(int index) { - return operations_.get(index); - } - /** - * - * - *
-     * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-     * for all operations.
-     * If '*' is present, the length of the slice must be one.
-     * Required.
-     * 
- * - * repeated string operations = 1; - */ - public com.google.protobuf.ByteString getOperationsBytes(int index) { - return operations_.getByteString(index); - } - - public static final int RULE_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule rule_; - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public boolean hasRule() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule() { - return rule_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() - : rule_; - } - /** - * - * - *
-     * Rule is embedded, it describes other criteria of the rule, like
-     * APIGroups, APIVersions, Resources, etc.
-     * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder - getRuleOrBuilder() { - return rule_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() - : rule_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < operations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operations_.getRaw(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(2, getRule()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < operations_.size(); i++) { - dataSize += computeStringSizeNoTag(operations_.getRaw(i)); - } - size += dataSize; - size += 1 * getOperationsList().size(); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRule()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) obj; - - boolean result = true; - result = result && getOperationsList().equals(other.getOperationsList()); - result = result && (hasRule() == other.hasRule()); - if (hasRule()) { - result = result && getRule().equals(other.getRule()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getOperationsCount() > 0) { - hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; - hash = (53 * hash) + getOperationsList().hashCode(); - } - if (hasRule()) { - hash = (37 * hash) + RULE_FIELD_NUMBER; - hash = (53 * hash) + getRule().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
-     * sure that all the tuple expansions are valid.
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperationsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.Builder - .class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getRuleFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - if (ruleBuilder_ == null) { - rule_ = null; - } else { - ruleBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - operations_ = operations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.operations_ = operations_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000001; - } - if (ruleBuilder_ == null) { - result.rule_ = rule_; - } else { - result.rule_ = ruleBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - .getDefaultInstance()) return this; - if (!other.operations_.isEmpty()) { - if (operations_.isEmpty()) { - operations_ = other.operations_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOperationsIsMutable(); - operations_.addAll(other.operations_); - } - onChanged(); - } - if (other.hasRule()) { - mergeRule(other.getRule()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList operations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureOperationsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - operations_ = new com.google.protobuf.LazyStringArrayList(operations_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public com.google.protobuf.ProtocolStringList getOperationsList() { - return operations_.getUnmodifiableView(); - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public int getOperationsCount() { - return operations_.size(); - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public java.lang.String getOperations(int index) { - return operations_.get(index); - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public com.google.protobuf.ByteString getOperationsBytes(int index) { - return operations_.getByteString(index); - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public Builder setOperations(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOperationsIsMutable(); - operations_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public Builder addOperations(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOperationsIsMutable(); - operations_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public Builder addAllOperations(java.lang.Iterable values) { - ensureOperationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operations_); - onChanged(); - return this; - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public Builder clearOperations() { - operations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
-       * for all operations.
-       * If '*' is present, the length of the slice must be one.
-       * Required.
-       * 
- * - * repeated string operations = 1; - */ - public Builder addOperationsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOperationsIsMutable(); - operations_.add(value); - onChanged(); - return this; - } - - private io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule rule_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - ruleBuilder_; - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public boolean hasRule() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule getRule() { - if (ruleBuilder_ == null) { - return rule_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() - : rule_; - } else { - return ruleBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public Builder setRule(io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { - if (ruleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - rule_ = value; - onChanged(); - } else { - ruleBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public Builder setRule( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder builderForValue) { - if (ruleBuilder_ == null) { - rule_ = builderForValue.build(); - onChanged(); - } else { - ruleBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public Builder mergeRule( - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule value) { - if (ruleBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && rule_ != null - && rule_ - != io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule - .getDefaultInstance()) { - rule_ = - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.newBuilder(rule_) - .mergeFrom(value) - .buildPartial(); - } else { - rule_ = value; - } - onChanged(); - } else { - ruleBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public Builder clearRule() { - if (ruleBuilder_ == null) { - rule_ = null; - onChanged(); - } else { - ruleBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder - getRuleBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getRuleFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder - getRuleOrBuilder() { - if (ruleBuilder_ != null) { - return ruleBuilder_.getMessageOrBuilder(); - } else { - return rule_ == null - ? io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.getDefaultInstance() - : rule_; - } - } - /** - * - * - *
-       * Rule is embedded, it describes other criteria of the rule, like
-       * APIGroups, APIVersions, Resources, etc.
-       * 
- * - * optional .k8s.io.api.admissionregistration.v1alpha1.Rule rule = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder> - getRuleFieldBuilder() { - if (ruleBuilder_ == null) { - ruleBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule, - io.kubernetes.client.proto.V1alpha1Admissionregistration.Rule.Builder, - io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleOrBuilder>( - getRule(), getParentForChildren(), isClean()); - rule_ = null; - } - return ruleBuilder_; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.RuleWithOperations) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public RuleWithOperations parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RuleWithOperations(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.RuleWithOperations - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ServiceReferenceOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - boolean hasNamespace(); - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - java.lang.String getNamespace(); - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - com.google.protobuf.ByteString getNamespaceBytes(); - - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - boolean hasName(); - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - java.lang.String getName(); - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - com.google.protobuf.ByteString getNameBytes(); - } - /** - * - * - *
-   * ServiceReference holds a reference to Service.legacy.k8s.io
-   * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ServiceReference} - */ - public static final class ServiceReference extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) - ServiceReferenceOrBuilder { - private static final long serialVersionUID = 0L; - // Use ServiceReference.newBuilder() to construct. - private ServiceReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ServiceReference() { - namespace_ = ""; - name_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ServiceReference( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - namespace_ = bs; - break; - } - case 18: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - name_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder - .class); - } - - private int bitField0_; - public static final int NAMESPACE_FIELD_NUMBER = 1; - private volatile java.lang.Object namespace_; - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - public boolean hasNamespace() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - public java.lang.String getNamespace() { - java.lang.Object ref = namespace_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - namespace_ = s; - } - return s; - } - } - /** - * - * - *
-     * Namespace is the namespace of the service
-     * Required
-     * 
- * - * optional string namespace = 1; - */ - public com.google.protobuf.ByteString getNamespaceBytes() { - java.lang.Object ref = namespace_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namespace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } - } - /** - * - * - *
-     * Name is the name of the service
-     * Required
-     * 
- * - * optional string name = 2; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespace_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespace_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference other = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) obj; - - boolean result = true; - result = result && (hasNamespace() == other.hasNamespace()); - if (hasNamespace()) { - result = result && getNamespace().equals(other.getNamespace()); - } - result = result && (hasName() == other.hasName()); - if (hasName()) { - result = result && getName().equals(other.getName()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasNamespace()) { - hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; - hash = (53 * hash) + getNamespace().hashCode(); - } - if (hasName()) { - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * ServiceReference holds a reference to Service.legacy.k8s.io
-     * 
- * - * Protobuf type {@code k8s.io.api.admissionregistration.v1alpha1.ServiceReference} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReferenceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.class, - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.Builder - .class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - namespace_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration - .internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance(); - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference build() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - buildPartial() { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference result = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.namespace_ = namespace_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) { - return mergeFrom( - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference other) { - if (other - == io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - .getDefaultInstance()) return this; - if (other.hasNamespace()) { - bitField0_ |= 0x00000001; - namespace_ = other.namespace_; - onChanged(); - } - if (other.hasName()) { - bitField0_ |= 0x00000002; - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object namespace_ = ""; - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public boolean hasNamespace() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public java.lang.String getNamespace() { - java.lang.Object ref = namespace_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - namespace_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public com.google.protobuf.ByteString getNamespaceBytes() { - java.lang.Object ref = namespace_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - namespace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public Builder setNamespace(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - namespace_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public Builder clearNamespace() { - bitField0_ = (bitField0_ & ~0x00000001); - namespace_ = getDefaultInstance().getNamespace(); - onChanged(); - return this; - } - /** - * - * - *
-       * Namespace is the namespace of the service
-       * Required
-       * 
- * - * optional string namespace = 1; - */ - public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - namespace_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Name is the name of the service
-       * Required
-       * 
- * - * optional string name = 2; - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - name_ = value; - onChanged(); - return this; - } - - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.admissionregistration.v1alpha1.ServiceReference) - private static final io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference(); - } - - public static io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ServiceReference parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceReference(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.kubernetes.client.proto.V1alpha1Admissionregistration.ServiceReference - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n9k8s.io/api/admissionregistration/v1alp" - + "ha1/generated.proto\022)k8s.io.api.admissio" - + "nregistration.v1alpha1\0324k8s.io/apimachin" - + "ery/pkg/apis/meta/v1/generated.proto\032/k8" - + "s.io/apimachinery/pkg/runtime/generated." - + "proto\0326k8s.io/apimachinery/pkg/runtime/s" - + "chema/generated.proto\0323k8s.io/apimachine" - + "ry/pkg/util/intstr/generated.proto\"\214\001\n\031A" - + "dmissionHookClientConfig\022L\n\007service\030\001 \001(" - + "\0132;.k8s.io.api.admissionregistration.v1a", - "lpha1.ServiceReference\022\017\n\007urlPath\030\003 \001(\t\022" - + "\020\n\010caBundle\030\002 \001(\014\"\346\001\n\025ExternalAdmissionH" - + "ook\022\014\n\004name\030\001 \001(\t\022Z\n\014clientConfig\030\002 \001(\0132" - + "D.k8s.io.api.admissionregistration.v1alp" - + "ha1.AdmissionHookClientConfig\022L\n\005rules\030\003" - + " \003(\0132=.k8s.io.api.admissionregistration." - + "v1alpha1.RuleWithOperations\022\025\n\rfailurePo" - + "licy\030\004 \001(\t\"\312\001\n\"ExternalAdmissionHookConf" - + "iguration\022B\n\010metadata\030\001 \001(\01320.k8s.io.api" - + "machinery.pkg.apis.meta.v1.ObjectMeta\022`\n", - "\026externalAdmissionHooks\030\002 \003(\0132@.k8s.io.a" - + "pi.admissionregistration.v1alpha1.Extern" - + "alAdmissionHook\"\310\001\n&ExternalAdmissionHoo" - + "kConfigurationList\022@\n\010metadata\030\001 \001(\0132..k" - + "8s.io.apimachinery.pkg.apis.meta.v1.List" - + "Meta\022\\\n\005items\030\002 \003(\0132M.k8s.io.api.admissi" - + "onregistration.v1alpha1.ExternalAdmissio" - + "nHookConfiguration\"[\n\013Initializer\022\014\n\004nam" - + "e\030\001 \001(\t\022>\n\005rules\030\002 \003(\0132/.k8s.io.api.admi" - + "ssionregistration.v1alpha1.Rule\"\254\001\n\030Init", - "ializerConfiguration\022B\n\010metadata\030\001 \001(\01320" - + ".k8s.io.apimachinery.pkg.apis.meta.v1.Ob" - + "jectMeta\022L\n\014initializers\030\002 \003(\01326.k8s.io." - + "api.admissionregistration.v1alpha1.Initi" - + "alizer\"\264\001\n\034InitializerConfigurationList\022" - + "@\n\010metadata\030\001 \001(\0132..k8s.io.apimachinery." - + "pkg.apis.meta.v1.ListMeta\022R\n\005items\030\002 \003(\013" - + "2C.k8s.io.api.admissionregistration.v1al" - + "pha1.InitializerConfiguration\"A\n\004Rule\022\021\n" - + "\tapiGroups\030\001 \003(\t\022\023\n\013apiVersions\030\002 \003(\t\022\021\n", - "\tresources\030\003 \003(\t\"g\n\022RuleWithOperations\022\022" - + "\n\noperations\030\001 \003(\t\022=\n\004rule\030\002 \001(\0132/.k8s.i" - + "o.api.admissionregistration.v1alpha1.Rul" - + "e\"3\n\020ServiceReference\022\021\n\tnamespace\030\001 \001(\t" - + "\022\014\n\004name\030\002 \001(\tBE\n\032io.kubernetes.client.p" - + "rotoB\035V1alpha1AdmissionregistrationZ\010v1a" - + "lpha1" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.kubernetes.client.proto.Meta.getDescriptor(), - io.kubernetes.client.proto.Runtime.getDescriptor(), - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), - io.kubernetes.client.proto.IntStr.getDescriptor(), - }, - assigner); - internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_AdmissionHookClientConfig_descriptor, - new java.lang.String[] { - "Service", "UrlPath", "CaBundle", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHook_descriptor, - new java.lang.String[] { - "Name", "ClientConfig", "Rules", "FailurePolicy", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfiguration_descriptor, - new java.lang.String[] { - "Metadata", "ExternalAdmissionHooks", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_ExternalAdmissionHookConfigurationList_descriptor, - new java.lang.String[] { - "Metadata", "Items", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_Initializer_descriptor, - new java.lang.String[] { - "Name", "Rules", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfiguration_descriptor, - new java.lang.String[] { - "Metadata", "Initializers", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_InitializerConfigurationList_descriptor, - new java.lang.String[] { - "Metadata", "Items", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_Rule_descriptor, - new java.lang.String[] { - "ApiGroups", "ApiVersions", "Resources", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_RuleWithOperations_descriptor, - new java.lang.String[] { - "Operations", "Rule", - }); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_admissionregistration_v1alpha1_ServiceReference_descriptor, - new java.lang.String[] { - "Namespace", "Name", - }); - io.kubernetes.client.proto.Meta.getDescriptor(); - io.kubernetes.client.proto.Runtime.getDescriptor(); - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); - io.kubernetes.client.proto.IntStr.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java b/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java deleted file mode 100644 index 9b5ee6bb7c..0000000000 --- a/proto/src/main/java/io/kubernetes/client/proto/V1alpha1Settings.java +++ /dev/null @@ -1,5571 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.proto; - -public final class V1alpha1Settings { - private V1alpha1Settings() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface PodPresetOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPreset) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - boolean hasSpec(); - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec(); - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder(); - } - /** - * - * - *
-   * PodPreset is a policy resource that defines additional runtime
-   * requirements for a Pod.
-   * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPreset} - */ - public static final class PodPreset extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPreset) - PodPresetOrBuilder { - private static final long serialVersionUID = 0L; - // Use PodPreset.newBuilder() to construct. - private PodPreset(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PodPreset() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PodPreset( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = spec_.toBuilder(); - } - spec_ = - input.readMessage( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(spec_); - spec_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int SPEC_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec spec_; - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec() { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() - : spec_; - } - /** - * - * - *
-     * +optional
-     * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder() { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() - : spec_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getSpec()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPreset)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Settings.PodPreset other = - (io.kubernetes.client.proto.V1alpha1Settings.PodPreset) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && (hasSpec() == other.hasSpec()); - if (hasSpec()) { - result = result && getSpec().equals(other.getSpec()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (hasSpec()) { - hash = (37 * hash) + SPEC_FIELD_NUMBER; - hash = (53 * hash) + getSpec().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Settings.PodPreset prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * PodPreset is a policy resource that defines additional runtime
-     * requirements for a Pod.
-     * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPreset} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPreset) - io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V1alpha1Settings.PodPreset.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getSpecFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (specBuilder_ == null) { - spec_ = null; - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset build() { - io.kubernetes.client.proto.V1alpha1Settings.PodPreset result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset buildPartial() { - io.kubernetes.client.proto.V1alpha1Settings.PodPreset result = - new io.kubernetes.client.proto.V1alpha1Settings.PodPreset(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (specBuilder_ == null) { - result.spec_ = spec_; - } else { - result.spec_ = specBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPreset) { - return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPreset) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPreset other) { - if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.hasSpec()) { - mergeSpec(other.getSpec()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Settings.PodPreset parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Settings.PodPreset) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec spec_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder> - specBuilder_; - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getSpec() { - if (specBuilder_ == null) { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() - : spec_; - } else { - return specBuilder_.getMessage(); - } - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public Builder setSpec(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec value) { - if (specBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - spec_ = value; - onChanged(); - } else { - specBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public Builder setSpec( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder builderForValue) { - if (specBuilder_ == null) { - spec_ = builderForValue.build(); - onChanged(); - } else { - specBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public Builder mergeSpec(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec value) { - if (specBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && spec_ != null - && spec_ - != io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec - .getDefaultInstance()) { - spec_ = - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.newBuilder(spec_) - .mergeFrom(value) - .buildPartial(); - } else { - spec_ = value; - } - onChanged(); - } else { - specBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public Builder clearSpec() { - if (specBuilder_ == null) { - spec_ = null; - onChanged(); - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder getSpecBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder getSpecOrBuilder() { - if (specBuilder_ != null) { - return specBuilder_.getMessageOrBuilder(); - } else { - return spec_ == null - ? io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance() - : spec_; - } - } - /** - * - * - *
-       * +optional
-       * 
- * - * optional .k8s.io.api.settings.v1alpha1.PodPresetSpec spec = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder> - getSpecFieldBuilder() { - if (specBuilder_ == null) { - specBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder>( - getSpec(), getParentForChildren(), isClean()); - spec_ = null; - } - return specBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPreset) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPreset) - private static final io.kubernetes.client.proto.V1alpha1Settings.PodPreset DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPreset(); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PodPreset parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PodPreset(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface PodPresetListOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPresetList) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMeta getMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - java.util.List getItemsList(); - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index); - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - int getItemsCount(); - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - java.util.List - getItemsOrBuilderList(); - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder(int index); - } - /** - * - * - *
-   * PodPresetList is a list of PodPreset objects.
-   * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetList} - */ - public static final class PodPresetList extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPresetList) - PodPresetListOrBuilder { - private static final long serialVersionUID = 0L; - // Use PodPresetList.newBuilder() to construct. - private PodPresetList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PodPresetList() { - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PodPresetList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList< - io.kubernetes.client.proto.V1alpha1Settings.PodPreset>(); - mutable_bitField0_ |= 0x00000002; - } - items_.add( - input.readMessage( - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.PARSER, - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ListMeta metadata_; - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - - public static final int ITEMS_FIELD_NUMBER = 2; - private java.util.List items_; - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public java.util.List getItemsList() { - return items_; - } - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public java.util.List - getItemsOrBuilderList() { - return items_; - } - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public int getItemsCount() { - return items_.size(); - } - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index) { - return items_.get(index); - } - /** - * - * - *
-     * Items is a list of schema objects.
-     * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder( - int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(2, items_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetList)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList other = - (io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && getItemsList().equals(other.getItemsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * PodPresetList is a list of PodPreset objects.
-     * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetList} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPresetList) - io.kubernetes.client.proto.V1alpha1Settings.PodPresetListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getItemsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - itemsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList build() { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList buildPartial() { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList result = - new io.kubernetes.client.proto.V1alpha1Settings.PodPresetList(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) { - return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPresetList other) { - if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPresetList.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getItemsFieldBuilder() - : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Settings.PodPresetList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List items_ = - java.util.Collections.emptyList(); - - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList( - items_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPreset, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> - itemsBuilder_; - - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public java.util.List getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder setItems( - int index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder setItems( - int index, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder addItems(io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder addItems( - int index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder addItems( - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder addItems( - int index, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder addAllItems( - java.lang.Iterable - values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder getItemsBuilder( - int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder getItemsOrBuilder( - int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public java.util.List< - ? extends io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder addItemsBuilder() { - return getItemsFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()); - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder addItemsBuilder( - int index) { - return getItemsFieldBuilder() - .addBuilder( - index, io.kubernetes.client.proto.V1alpha1Settings.PodPreset.getDefaultInstance()); - } - /** - * - * - *
-       * Items is a list of schema objects.
-       * 
- * - * repeated .k8s.io.api.settings.v1alpha1.PodPreset items = 2; - */ - public java.util.List - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPreset, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1alpha1Settings.PodPreset, - io.kubernetes.client.proto.V1alpha1Settings.PodPreset.Builder, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetOrBuilder>( - items_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPresetList) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPresetList) - private static final io.kubernetes.client.proto.V1alpha1Settings.PodPresetList DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPresetList(); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PodPresetList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PodPresetList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface PodPresetSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.settings.v1alpha1.PodPresetSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - boolean hasSelector(); - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - io.kubernetes.client.proto.Meta.LabelSelector getSelector(); - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder(); - - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - java.util.List getEnvList(); - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - io.kubernetes.client.proto.V1.EnvVar getEnv(int index); - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - int getEnvCount(); - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - java.util.List getEnvOrBuilderList(); - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index); - - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - java.util.List getEnvFromList(); - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index); - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - int getEnvFromCount(); - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - java.util.List - getEnvFromOrBuilderList(); - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index); - - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - java.util.List getVolumesList(); - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - io.kubernetes.client.proto.V1.Volume getVolumes(int index); - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - int getVolumesCount(); - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - java.util.List - getVolumesOrBuilderList(); - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index); - - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - java.util.List getVolumeMountsList(); - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index); - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - int getVolumeMountsCount(); - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - java.util.List - getVolumeMountsOrBuilderList(); - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder(int index); - } - /** - * - * - *
-   * PodPresetSpec is a description of a pod preset.
-   * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetSpec} - */ - public static final class PodPresetSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.settings.v1alpha1.PodPresetSpec) - PodPresetSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use PodPresetSpec.newBuilder() to construct. - private PodPresetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PodPresetSpec() { - env_ = java.util.Collections.emptyList(); - envFrom_ = java.util.Collections.emptyList(); - volumes_ = java.util.Collections.emptyList(); - volumeMounts_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PodPresetSpec( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.LabelSelector.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = selector_.toBuilder(); - } - selector_ = - input.readMessage( - io.kubernetes.client.proto.Meta.LabelSelector.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(selector_); - selector_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - env_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - env_.add( - input.readMessage( - io.kubernetes.client.proto.V1.EnvVar.PARSER, extensionRegistry)); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - envFrom_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - envFrom_.add( - input.readMessage( - io.kubernetes.client.proto.V1.EnvFromSource.PARSER, extensionRegistry)); - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - volumes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - volumes_.add( - input.readMessage( - io.kubernetes.client.proto.V1.Volume.PARSER, extensionRegistry)); - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - volumeMounts_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - volumeMounts_.add( - input.readMessage( - io.kubernetes.client.proto.V1.VolumeMount.PARSER, extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - env_ = java.util.Collections.unmodifiableList(env_); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - envFrom_ = java.util.Collections.unmodifiableList(envFrom_); - } - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - volumes_ = java.util.Collections.unmodifiableList(volumes_); - } - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - volumeMounts_ = java.util.Collections.unmodifiableList(volumeMounts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder.class); - } - - private int bitField0_; - public static final int SELECTOR_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.LabelSelector selector_; - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - public boolean hasSelector() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - public io.kubernetes.client.proto.Meta.LabelSelector getSelector() { - return selector_ == null - ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() - : selector_; - } - /** - * - * - *
-     * Selector is a label query over a set of resources, in this case pods.
-     * Required.
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - */ - public io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder() { - return selector_ == null - ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() - : selector_; - } - - public static final int ENV_FIELD_NUMBER = 2; - private java.util.List env_; - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public java.util.List getEnvList() { - return env_; - } - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public java.util.List - getEnvOrBuilderList() { - return env_; - } - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public int getEnvCount() { - return env_.size(); - } - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVar getEnv(int index) { - return env_.get(index); - } - /** - * - * - *
-     * Env defines the collection of EnvVar to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index) { - return env_.get(index); - } - - public static final int ENVFROM_FIELD_NUMBER = 3; - private java.util.List envFrom_; - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public java.util.List getEnvFromList() { - return envFrom_; - } - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public java.util.List - getEnvFromOrBuilderList() { - return envFrom_; - } - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public int getEnvFromCount() { - return envFrom_.size(); - } - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index) { - return envFrom_.get(index); - } - /** - * - * - *
-     * EnvFrom defines the collection of EnvFromSource to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index) { - return envFrom_.get(index); - } - - public static final int VOLUMES_FIELD_NUMBER = 4; - private java.util.List volumes_; - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public java.util.List getVolumesList() { - return volumes_; - } - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public java.util.List - getVolumesOrBuilderList() { - return volumes_; - } - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public int getVolumesCount() { - return volumes_.size(); - } - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.Volume getVolumes(int index) { - return volumes_.get(index); - } - /** - * - * - *
-     * Volumes defines the collection of Volume to inject into the pod.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index) { - return volumes_.get(index); - } - - public static final int VOLUMEMOUNTS_FIELD_NUMBER = 5; - private java.util.List volumeMounts_; - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public java.util.List getVolumeMountsList() { - return volumeMounts_; - } - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public java.util.List - getVolumeMountsOrBuilderList() { - return volumeMounts_; - } - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public int getVolumeMountsCount() { - return volumeMounts_.size(); - } - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index) { - return volumeMounts_.get(index); - } - /** - * - * - *
-     * VolumeMounts defines the collection of VolumeMount to inject into containers.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder(int index) { - return volumeMounts_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getSelector()); - } - for (int i = 0; i < env_.size(); i++) { - output.writeMessage(2, env_.get(i)); - } - for (int i = 0; i < envFrom_.size(); i++) { - output.writeMessage(3, envFrom_.get(i)); - } - for (int i = 0; i < volumes_.size(); i++) { - output.writeMessage(4, volumes_.get(i)); - } - for (int i = 0; i < volumeMounts_.size(); i++) { - output.writeMessage(5, volumeMounts_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSelector()); - } - for (int i = 0; i < env_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, env_.get(i)); - } - for (int i = 0; i < envFrom_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, envFrom_.get(i)); - } - for (int i = 0; i < volumes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, volumes_.get(i)); - } - for (int i = 0; i < volumeMounts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, volumeMounts_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec other = - (io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) obj; - - boolean result = true; - result = result && (hasSelector() == other.hasSelector()); - if (hasSelector()) { - result = result && getSelector().equals(other.getSelector()); - } - result = result && getEnvList().equals(other.getEnvList()); - result = result && getEnvFromList().equals(other.getEnvFromList()); - result = result && getVolumesList().equals(other.getVolumesList()); - result = result && getVolumeMountsList().equals(other.getVolumeMountsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSelector()) { - hash = (37 * hash) + SELECTOR_FIELD_NUMBER; - hash = (53 * hash) + getSelector().hashCode(); - } - if (getEnvCount() > 0) { - hash = (37 * hash) + ENV_FIELD_NUMBER; - hash = (53 * hash) + getEnvList().hashCode(); - } - if (getEnvFromCount() > 0) { - hash = (37 * hash) + ENVFROM_FIELD_NUMBER; - hash = (53 * hash) + getEnvFromList().hashCode(); - } - if (getVolumesCount() > 0) { - hash = (37 * hash) + VOLUMES_FIELD_NUMBER; - hash = (53 * hash) + getVolumesList().hashCode(); - } - if (getVolumeMountsCount() > 0) { - hash = (37 * hash) + VOLUMEMOUNTS_FIELD_NUMBER; - hash = (53 * hash) + getVolumeMountsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * PodPresetSpec is a description of a pod preset.
-     * 
- * - * Protobuf type {@code k8s.io.api.settings.v1alpha1.PodPresetSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.settings.v1alpha1.PodPresetSpec) - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.class, - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.Builder.class); - } - - // Construct using - // io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSelectorFieldBuilder(); - getEnvFieldBuilder(); - getEnvFromFieldBuilder(); - getVolumesFieldBuilder(); - getVolumeMountsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (selectorBuilder_ == null) { - selector_ = null; - } else { - selectorBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (envBuilder_ == null) { - env_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - envBuilder_.clear(); - } - if (envFromBuilder_ == null) { - envFrom_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - envFromBuilder_.clear(); - } - if (volumesBuilder_ == null) { - volumes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - volumesBuilder_.clear(); - } - if (volumeMountsBuilder_ == null) { - volumeMounts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - volumeMountsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V1alpha1Settings - .internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstanceForType() { - return io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec build() { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec buildPartial() { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec result = - new io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (selectorBuilder_ == null) { - result.selector_ = selector_; - } else { - result.selector_ = selectorBuilder_.build(); - } - if (envBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - env_ = java.util.Collections.unmodifiableList(env_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.env_ = env_; - } else { - result.env_ = envBuilder_.build(); - } - if (envFromBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - envFrom_ = java.util.Collections.unmodifiableList(envFrom_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.envFrom_ = envFrom_; - } else { - result.envFrom_ = envFromBuilder_.build(); - } - if (volumesBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008)) { - volumes_ = java.util.Collections.unmodifiableList(volumes_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.volumes_ = volumes_; - } else { - result.volumes_ = volumesBuilder_.build(); - } - if (volumeMountsBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010)) { - volumeMounts_ = java.util.Collections.unmodifiableList(volumeMounts_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.volumeMounts_ = volumeMounts_; - } else { - result.volumeMounts_ = volumeMountsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) { - return mergeFrom((io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec other) { - if (other == io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec.getDefaultInstance()) - return this; - if (other.hasSelector()) { - mergeSelector(other.getSelector()); - } - if (envBuilder_ == null) { - if (!other.env_.isEmpty()) { - if (env_.isEmpty()) { - env_ = other.env_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEnvIsMutable(); - env_.addAll(other.env_); - } - onChanged(); - } - } else { - if (!other.env_.isEmpty()) { - if (envBuilder_.isEmpty()) { - envBuilder_.dispose(); - envBuilder_ = null; - env_ = other.env_; - bitField0_ = (bitField0_ & ~0x00000002); - envBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEnvFieldBuilder() - : null; - } else { - envBuilder_.addAllMessages(other.env_); - } - } - } - if (envFromBuilder_ == null) { - if (!other.envFrom_.isEmpty()) { - if (envFrom_.isEmpty()) { - envFrom_ = other.envFrom_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureEnvFromIsMutable(); - envFrom_.addAll(other.envFrom_); - } - onChanged(); - } - } else { - if (!other.envFrom_.isEmpty()) { - if (envFromBuilder_.isEmpty()) { - envFromBuilder_.dispose(); - envFromBuilder_ = null; - envFrom_ = other.envFrom_; - bitField0_ = (bitField0_ & ~0x00000004); - envFromBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEnvFromFieldBuilder() - : null; - } else { - envFromBuilder_.addAllMessages(other.envFrom_); - } - } - } - if (volumesBuilder_ == null) { - if (!other.volumes_.isEmpty()) { - if (volumes_.isEmpty()) { - volumes_ = other.volumes_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureVolumesIsMutable(); - volumes_.addAll(other.volumes_); - } - onChanged(); - } - } else { - if (!other.volumes_.isEmpty()) { - if (volumesBuilder_.isEmpty()) { - volumesBuilder_.dispose(); - volumesBuilder_ = null; - volumes_ = other.volumes_; - bitField0_ = (bitField0_ & ~0x00000008); - volumesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getVolumesFieldBuilder() - : null; - } else { - volumesBuilder_.addAllMessages(other.volumes_); - } - } - } - if (volumeMountsBuilder_ == null) { - if (!other.volumeMounts_.isEmpty()) { - if (volumeMounts_.isEmpty()) { - volumeMounts_ = other.volumeMounts_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureVolumeMountsIsMutable(); - volumeMounts_.addAll(other.volumeMounts_); - } - onChanged(); - } - } else { - if (!other.volumeMounts_.isEmpty()) { - if (volumeMountsBuilder_.isEmpty()) { - volumeMountsBuilder_.dispose(); - volumeMountsBuilder_ = null; - volumeMounts_ = other.volumeMounts_; - bitField0_ = (bitField0_ & ~0x00000010); - volumeMountsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getVolumeMountsFieldBuilder() - : null; - } else { - volumeMountsBuilder_.addAllMessages(other.volumeMounts_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.LabelSelector selector_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.LabelSelector, - io.kubernetes.client.proto.Meta.LabelSelector.Builder, - io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder> - selectorBuilder_; - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public boolean hasSelector() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public io.kubernetes.client.proto.Meta.LabelSelector getSelector() { - if (selectorBuilder_ == null) { - return selector_ == null - ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() - : selector_; - } else { - return selectorBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public Builder setSelector(io.kubernetes.client.proto.Meta.LabelSelector value) { - if (selectorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - selector_ = value; - onChanged(); - } else { - selectorBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public Builder setSelector( - io.kubernetes.client.proto.Meta.LabelSelector.Builder builderForValue) { - if (selectorBuilder_ == null) { - selector_ = builderForValue.build(); - onChanged(); - } else { - selectorBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public Builder mergeSelector(io.kubernetes.client.proto.Meta.LabelSelector value) { - if (selectorBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && selector_ != null - && selector_ != io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance()) { - selector_ = - io.kubernetes.client.proto.Meta.LabelSelector.newBuilder(selector_) - .mergeFrom(value) - .buildPartial(); - } else { - selector_ = value; - } - onChanged(); - } else { - selectorBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public Builder clearSelector() { - if (selectorBuilder_ == null) { - selector_ = null; - onChanged(); - } else { - selectorBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public io.kubernetes.client.proto.Meta.LabelSelector.Builder getSelectorBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getSelectorFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - public io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder getSelectorOrBuilder() { - if (selectorBuilder_ != null) { - return selectorBuilder_.getMessageOrBuilder(); - } else { - return selector_ == null - ? io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance() - : selector_; - } - } - /** - * - * - *
-       * Selector is a label query over a set of resources, in this case pods.
-       * Required.
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.LabelSelector, - io.kubernetes.client.proto.Meta.LabelSelector.Builder, - io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder> - getSelectorFieldBuilder() { - if (selectorBuilder_ == null) { - selectorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.LabelSelector, - io.kubernetes.client.proto.Meta.LabelSelector.Builder, - io.kubernetes.client.proto.Meta.LabelSelectorOrBuilder>( - getSelector(), getParentForChildren(), isClean()); - selector_ = null; - } - return selectorBuilder_; - } - - private java.util.List env_ = - java.util.Collections.emptyList(); - - private void ensureEnvIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - env_ = new java.util.ArrayList(env_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvVar, - io.kubernetes.client.proto.V1.EnvVar.Builder, - io.kubernetes.client.proto.V1.EnvVarOrBuilder> - envBuilder_; - - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public java.util.List getEnvList() { - if (envBuilder_ == null) { - return java.util.Collections.unmodifiableList(env_); - } else { - return envBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public int getEnvCount() { - if (envBuilder_ == null) { - return env_.size(); - } else { - return envBuilder_.getCount(); - } - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVar getEnv(int index) { - if (envBuilder_ == null) { - return env_.get(index); - } else { - return envBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder setEnv(int index, io.kubernetes.client.proto.V1.EnvVar value) { - if (envBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvIsMutable(); - env_.set(index, value); - onChanged(); - } else { - envBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder setEnv( - int index, io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { - if (envBuilder_ == null) { - ensureEnvIsMutable(); - env_.set(index, builderForValue.build()); - onChanged(); - } else { - envBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder addEnv(io.kubernetes.client.proto.V1.EnvVar value) { - if (envBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvIsMutable(); - env_.add(value); - onChanged(); - } else { - envBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder addEnv(int index, io.kubernetes.client.proto.V1.EnvVar value) { - if (envBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvIsMutable(); - env_.add(index, value); - onChanged(); - } else { - envBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder addEnv(io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { - if (envBuilder_ == null) { - ensureEnvIsMutable(); - env_.add(builderForValue.build()); - onChanged(); - } else { - envBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder addEnv( - int index, io.kubernetes.client.proto.V1.EnvVar.Builder builderForValue) { - if (envBuilder_ == null) { - ensureEnvIsMutable(); - env_.add(index, builderForValue.build()); - onChanged(); - } else { - envBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder addAllEnv( - java.lang.Iterable values) { - if (envBuilder_ == null) { - ensureEnvIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, env_); - onChanged(); - } else { - envBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder clearEnv() { - if (envBuilder_ == null) { - env_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - envBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public Builder removeEnv(int index) { - if (envBuilder_ == null) { - ensureEnvIsMutable(); - env_.remove(index); - onChanged(); - } else { - envBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVar.Builder getEnvBuilder(int index) { - return getEnvFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVarOrBuilder getEnvOrBuilder(int index) { - if (envBuilder_ == null) { - return env_.get(index); - } else { - return envBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public java.util.List - getEnvOrBuilderList() { - if (envBuilder_ != null) { - return envBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(env_); - } - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVar.Builder addEnvBuilder() { - return getEnvFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1.EnvVar.getDefaultInstance()); - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public io.kubernetes.client.proto.V1.EnvVar.Builder addEnvBuilder(int index) { - return getEnvFieldBuilder() - .addBuilder(index, io.kubernetes.client.proto.V1.EnvVar.getDefaultInstance()); - } - /** - * - * - *
-       * Env defines the collection of EnvVar to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvVar env = 2; - */ - public java.util.List getEnvBuilderList() { - return getEnvFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvVar, - io.kubernetes.client.proto.V1.EnvVar.Builder, - io.kubernetes.client.proto.V1.EnvVarOrBuilder> - getEnvFieldBuilder() { - if (envBuilder_ == null) { - envBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvVar, - io.kubernetes.client.proto.V1.EnvVar.Builder, - io.kubernetes.client.proto.V1.EnvVarOrBuilder>( - env_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - env_ = null; - } - return envBuilder_; - } - - private java.util.List envFrom_ = - java.util.Collections.emptyList(); - - private void ensureEnvFromIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - envFrom_ = new java.util.ArrayList(envFrom_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvFromSource, - io.kubernetes.client.proto.V1.EnvFromSource.Builder, - io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder> - envFromBuilder_; - - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public java.util.List getEnvFromList() { - if (envFromBuilder_ == null) { - return java.util.Collections.unmodifiableList(envFrom_); - } else { - return envFromBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public int getEnvFromCount() { - if (envFromBuilder_ == null) { - return envFrom_.size(); - } else { - return envFromBuilder_.getCount(); - } - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSource getEnvFrom(int index) { - if (envFromBuilder_ == null) { - return envFrom_.get(index); - } else { - return envFromBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder setEnvFrom(int index, io.kubernetes.client.proto.V1.EnvFromSource value) { - if (envFromBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvFromIsMutable(); - envFrom_.set(index, value); - onChanged(); - } else { - envFromBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder setEnvFrom( - int index, io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { - if (envFromBuilder_ == null) { - ensureEnvFromIsMutable(); - envFrom_.set(index, builderForValue.build()); - onChanged(); - } else { - envFromBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder addEnvFrom(io.kubernetes.client.proto.V1.EnvFromSource value) { - if (envFromBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvFromIsMutable(); - envFrom_.add(value); - onChanged(); - } else { - envFromBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder addEnvFrom(int index, io.kubernetes.client.proto.V1.EnvFromSource value) { - if (envFromBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvFromIsMutable(); - envFrom_.add(index, value); - onChanged(); - } else { - envFromBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder addEnvFrom( - io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { - if (envFromBuilder_ == null) { - ensureEnvFromIsMutable(); - envFrom_.add(builderForValue.build()); - onChanged(); - } else { - envFromBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder addEnvFrom( - int index, io.kubernetes.client.proto.V1.EnvFromSource.Builder builderForValue) { - if (envFromBuilder_ == null) { - ensureEnvFromIsMutable(); - envFrom_.add(index, builderForValue.build()); - onChanged(); - } else { - envFromBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder addAllEnvFrom( - java.lang.Iterable values) { - if (envFromBuilder_ == null) { - ensureEnvFromIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, envFrom_); - onChanged(); - } else { - envFromBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder clearEnvFrom() { - if (envFromBuilder_ == null) { - envFrom_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - envFromBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public Builder removeEnvFrom(int index) { - if (envFromBuilder_ == null) { - ensureEnvFromIsMutable(); - envFrom_.remove(index); - onChanged(); - } else { - envFromBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSource.Builder getEnvFromBuilder(int index) { - return getEnvFromFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder getEnvFromOrBuilder(int index) { - if (envFromBuilder_ == null) { - return envFrom_.get(index); - } else { - return envFromBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public java.util.List - getEnvFromOrBuilderList() { - if (envFromBuilder_ != null) { - return envFromBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(envFrom_); - } - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSource.Builder addEnvFromBuilder() { - return getEnvFromFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1.EnvFromSource.getDefaultInstance()); - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public io.kubernetes.client.proto.V1.EnvFromSource.Builder addEnvFromBuilder(int index) { - return getEnvFromFieldBuilder() - .addBuilder(index, io.kubernetes.client.proto.V1.EnvFromSource.getDefaultInstance()); - } - /** - * - * - *
-       * EnvFrom defines the collection of EnvFromSource to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.EnvFromSource envFrom = 3; - */ - public java.util.List - getEnvFromBuilderList() { - return getEnvFromFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvFromSource, - io.kubernetes.client.proto.V1.EnvFromSource.Builder, - io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder> - getEnvFromFieldBuilder() { - if (envFromBuilder_ == null) { - envFromBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.EnvFromSource, - io.kubernetes.client.proto.V1.EnvFromSource.Builder, - io.kubernetes.client.proto.V1.EnvFromSourceOrBuilder>( - envFrom_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - envFrom_ = null; - } - return envFromBuilder_; - } - - private java.util.List volumes_ = - java.util.Collections.emptyList(); - - private void ensureVolumesIsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { - volumes_ = new java.util.ArrayList(volumes_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.Volume, - io.kubernetes.client.proto.V1.Volume.Builder, - io.kubernetes.client.proto.V1.VolumeOrBuilder> - volumesBuilder_; - - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public java.util.List getVolumesList() { - if (volumesBuilder_ == null) { - return java.util.Collections.unmodifiableList(volumes_); - } else { - return volumesBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public int getVolumesCount() { - if (volumesBuilder_ == null) { - return volumes_.size(); - } else { - return volumesBuilder_.getCount(); - } - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.Volume getVolumes(int index) { - if (volumesBuilder_ == null) { - return volumes_.get(index); - } else { - return volumesBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder setVolumes(int index, io.kubernetes.client.proto.V1.Volume value) { - if (volumesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumesIsMutable(); - volumes_.set(index, value); - onChanged(); - } else { - volumesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder setVolumes( - int index, io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { - if (volumesBuilder_ == null) { - ensureVolumesIsMutable(); - volumes_.set(index, builderForValue.build()); - onChanged(); - } else { - volumesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder addVolumes(io.kubernetes.client.proto.V1.Volume value) { - if (volumesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumesIsMutable(); - volumes_.add(value); - onChanged(); - } else { - volumesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder addVolumes(int index, io.kubernetes.client.proto.V1.Volume value) { - if (volumesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumesIsMutable(); - volumes_.add(index, value); - onChanged(); - } else { - volumesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder addVolumes(io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { - if (volumesBuilder_ == null) { - ensureVolumesIsMutable(); - volumes_.add(builderForValue.build()); - onChanged(); - } else { - volumesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder addVolumes( - int index, io.kubernetes.client.proto.V1.Volume.Builder builderForValue) { - if (volumesBuilder_ == null) { - ensureVolumesIsMutable(); - volumes_.add(index, builderForValue.build()); - onChanged(); - } else { - volumesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder addAllVolumes( - java.lang.Iterable values) { - if (volumesBuilder_ == null) { - ensureVolumesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumes_); - onChanged(); - } else { - volumesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder clearVolumes() { - if (volumesBuilder_ == null) { - volumes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - volumesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public Builder removeVolumes(int index) { - if (volumesBuilder_ == null) { - ensureVolumesIsMutable(); - volumes_.remove(index); - onChanged(); - } else { - volumesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.Volume.Builder getVolumesBuilder(int index) { - return getVolumesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.VolumeOrBuilder getVolumesOrBuilder(int index) { - if (volumesBuilder_ == null) { - return volumes_.get(index); - } else { - return volumesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public java.util.List - getVolumesOrBuilderList() { - if (volumesBuilder_ != null) { - return volumesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(volumes_); - } - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.Volume.Builder addVolumesBuilder() { - return getVolumesFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1.Volume.getDefaultInstance()); - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public io.kubernetes.client.proto.V1.Volume.Builder addVolumesBuilder(int index) { - return getVolumesFieldBuilder() - .addBuilder(index, io.kubernetes.client.proto.V1.Volume.getDefaultInstance()); - } - /** - * - * - *
-       * Volumes defines the collection of Volume to inject into the pod.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.Volume volumes = 4; - */ - public java.util.List getVolumesBuilderList() { - return getVolumesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.Volume, - io.kubernetes.client.proto.V1.Volume.Builder, - io.kubernetes.client.proto.V1.VolumeOrBuilder> - getVolumesFieldBuilder() { - if (volumesBuilder_ == null) { - volumesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.Volume, - io.kubernetes.client.proto.V1.Volume.Builder, - io.kubernetes.client.proto.V1.VolumeOrBuilder>( - volumes_, - ((bitField0_ & 0x00000008) == 0x00000008), - getParentForChildren(), - isClean()); - volumes_ = null; - } - return volumesBuilder_; - } - - private java.util.List volumeMounts_ = - java.util.Collections.emptyList(); - - private void ensureVolumeMountsIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - volumeMounts_ = - new java.util.ArrayList(volumeMounts_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.VolumeMount, - io.kubernetes.client.proto.V1.VolumeMount.Builder, - io.kubernetes.client.proto.V1.VolumeMountOrBuilder> - volumeMountsBuilder_; - - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public java.util.List getVolumeMountsList() { - if (volumeMountsBuilder_ == null) { - return java.util.Collections.unmodifiableList(volumeMounts_); - } else { - return volumeMountsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public int getVolumeMountsCount() { - if (volumeMountsBuilder_ == null) { - return volumeMounts_.size(); - } else { - return volumeMountsBuilder_.getCount(); - } - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMount getVolumeMounts(int index) { - if (volumeMountsBuilder_ == null) { - return volumeMounts_.get(index); - } else { - return volumeMountsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder setVolumeMounts(int index, io.kubernetes.client.proto.V1.VolumeMount value) { - if (volumeMountsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumeMountsIsMutable(); - volumeMounts_.set(index, value); - onChanged(); - } else { - volumeMountsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder setVolumeMounts( - int index, io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { - if (volumeMountsBuilder_ == null) { - ensureVolumeMountsIsMutable(); - volumeMounts_.set(index, builderForValue.build()); - onChanged(); - } else { - volumeMountsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder addVolumeMounts(io.kubernetes.client.proto.V1.VolumeMount value) { - if (volumeMountsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumeMountsIsMutable(); - volumeMounts_.add(value); - onChanged(); - } else { - volumeMountsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder addVolumeMounts(int index, io.kubernetes.client.proto.V1.VolumeMount value) { - if (volumeMountsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVolumeMountsIsMutable(); - volumeMounts_.add(index, value); - onChanged(); - } else { - volumeMountsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder addVolumeMounts( - io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { - if (volumeMountsBuilder_ == null) { - ensureVolumeMountsIsMutable(); - volumeMounts_.add(builderForValue.build()); - onChanged(); - } else { - volumeMountsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder addVolumeMounts( - int index, io.kubernetes.client.proto.V1.VolumeMount.Builder builderForValue) { - if (volumeMountsBuilder_ == null) { - ensureVolumeMountsIsMutable(); - volumeMounts_.add(index, builderForValue.build()); - onChanged(); - } else { - volumeMountsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder addAllVolumeMounts( - java.lang.Iterable values) { - if (volumeMountsBuilder_ == null) { - ensureVolumeMountsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumeMounts_); - onChanged(); - } else { - volumeMountsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder clearVolumeMounts() { - if (volumeMountsBuilder_ == null) { - volumeMounts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - volumeMountsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public Builder removeVolumeMounts(int index) { - if (volumeMountsBuilder_ == null) { - ensureVolumeMountsIsMutable(); - volumeMounts_.remove(index); - onChanged(); - } else { - volumeMountsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMount.Builder getVolumeMountsBuilder(int index) { - return getVolumeMountsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMountOrBuilder getVolumeMountsOrBuilder( - int index) { - if (volumeMountsBuilder_ == null) { - return volumeMounts_.get(index); - } else { - return volumeMountsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public java.util.List - getVolumeMountsOrBuilderList() { - if (volumeMountsBuilder_ != null) { - return volumeMountsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(volumeMounts_); - } - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMount.Builder addVolumeMountsBuilder() { - return getVolumeMountsFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1.VolumeMount.getDefaultInstance()); - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public io.kubernetes.client.proto.V1.VolumeMount.Builder addVolumeMountsBuilder(int index) { - return getVolumeMountsFieldBuilder() - .addBuilder(index, io.kubernetes.client.proto.V1.VolumeMount.getDefaultInstance()); - } - /** - * - * - *
-       * VolumeMounts defines the collection of VolumeMount to inject into containers.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.VolumeMount volumeMounts = 5; - */ - public java.util.List - getVolumeMountsBuilderList() { - return getVolumeMountsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.VolumeMount, - io.kubernetes.client.proto.V1.VolumeMount.Builder, - io.kubernetes.client.proto.V1.VolumeMountOrBuilder> - getVolumeMountsFieldBuilder() { - if (volumeMountsBuilder_ == null) { - volumeMountsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.VolumeMount, - io.kubernetes.client.proto.V1.VolumeMount.Builder, - io.kubernetes.client.proto.V1.VolumeMountOrBuilder>( - volumeMounts_, - ((bitField0_ & 0x00000010) == 0x00000010), - getParentForChildren(), - isClean()); - volumeMounts_ = null; - } - return volumeMountsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.settings.v1alpha1.PodPresetSpec) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.settings.v1alpha1.PodPresetSpec) - private static final io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec(); - } - - public static io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PodPresetSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PodPresetSpec(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V1alpha1Settings.PodPresetSpec getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n,k8s.io/api/settings/v1alpha1/generated" - + ".proto\022\034k8s.io.api.settings.v1alpha1\032\"k8" - + "s.io/api/core/v1/generated.proto\0324k8s.io" - + "/apimachinery/pkg/apis/meta/v1/generated" - + ".proto\032/k8s.io/apimachinery/pkg/runtime/" - + "generated.proto\0326k8s.io/apimachinery/pkg" - + "/runtime/schema/generated.proto\"\212\001\n\tPodP" - + "reset\022B\n\010metadata\030\001 \001(\01320.k8s.io.apimach" - + "inery.pkg.apis.meta.v1.ObjectMeta\0229\n\004spe" - + "c\030\002 \001(\0132+.k8s.io.api.settings.v1alpha1.P" - + "odPresetSpec\"\211\001\n\rPodPresetList\022@\n\010metada" - + "ta\030\001 \001(\0132..k8s.io.apimachinery.pkg.apis." - + "meta.v1.ListMeta\0226\n\005items\030\002 \003(\0132\'.k8s.io" - + ".api.settings.v1alpha1.PodPreset\"\227\002\n\rPod" - + "PresetSpec\022E\n\010selector\030\001 \001(\01323.k8s.io.ap" - + "imachinery.pkg.apis.meta.v1.LabelSelecto" - + "r\022\'\n\003env\030\002 \003(\0132\032.k8s.io.api.core.v1.EnvV" - + "ar\0222\n\007envFrom\030\003 \003(\0132!.k8s.io.api.core.v1" - + ".EnvFromSource\022+\n\007volumes\030\004 \003(\0132\032.k8s.io" - + ".api.core.v1.Volume\0225\n\014volumeMounts\030\005 \003(" - + "\0132\037.k8s.io.api.core.v1.VolumeMountB8\n\032io" - + ".kubernetes.client.protoB\020V1alpha1Settin" - + "gsZ\010v1alpha1" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.kubernetes.client.proto.V1.getDescriptor(), - io.kubernetes.client.proto.Meta.getDescriptor(), - io.kubernetes.client.proto.Runtime.getDescriptor(), - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), - }, - assigner); - internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_k8s_io_api_settings_v1alpha1_PodPreset_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_settings_v1alpha1_PodPreset_descriptor, - new java.lang.String[] { - "Metadata", "Spec", - }); - internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_settings_v1alpha1_PodPresetList_descriptor, - new java.lang.String[] { - "Metadata", "Items", - }); - internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_settings_v1alpha1_PodPresetSpec_descriptor, - new java.lang.String[] { - "Selector", "Env", "EnvFrom", "Volumes", "VolumeMounts", - }); - io.kubernetes.client.proto.V1.getDescriptor(); - io.kubernetes.client.proto.Meta.getDescriptor(); - io.kubernetes.client.proto.Runtime.getDescriptor(); - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java b/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java deleted file mode 100644 index 8f74e03ff4..0000000000 --- a/proto/src/main/java/io/kubernetes/client/proto/V2alpha1Batch.java +++ /dev/null @@ -1,8443 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.proto; - -public final class V2alpha1Batch { - private V2alpha1Batch() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface CronJobOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJob) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - boolean hasSpec(); - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec(); - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder(); - - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - boolean hasStatus(); - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus(); - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder(); - } - /** - * - * - *
-   * CronJob represents the configuration of a single cron job.
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJob} - */ - public static final class CronJob extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJob) - CronJobOrBuilder { - private static final long serialVersionUID = 0L; - // Use CronJob.newBuilder() to construct. - private CronJob(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CronJob() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CronJob( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = spec_.toBuilder(); - } - spec_ = - input.readMessage( - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(spec_); - spec_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: - { - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = status_.toBuilder(); - } - status_ = - input.readMessage( - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJob.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int SPEC_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec spec_; - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec() { - return spec_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() - : spec_; - } - /** - * - * - *
-     * Specification of the desired behavior of a cron job, including the schedule.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder() { - return spec_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() - : spec_; - } - - public static final int STATUS_FIELD_NUMBER = 3; - private io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus status_; - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus() { - return status_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() - : status_; - } - /** - * - * - *
-     * Current status of a cron job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder() { - return status_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() - : status_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getSpec()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, getStatus()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJob)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.CronJob other = - (io.kubernetes.client.proto.V2alpha1Batch.CronJob) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && (hasSpec() == other.hasSpec()); - if (hasSpec()) { - result = result && getSpec().equals(other.getSpec()); - } - result = result && (hasStatus() == other.hasStatus()); - if (hasStatus()) { - result = result && getStatus().equals(other.getStatus()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (hasSpec()) { - hash = (37 * hash) + SPEC_FIELD_NUMBER; - hash = (53 * hash) + getSpec().hashCode(); - } - if (hasStatus()) { - hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + getStatus().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.kubernetes.client.proto.V2alpha1Batch.CronJob prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * CronJob represents the configuration of a single cron job.
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJob} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJob) - io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJob.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJob.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getSpecFieldBuilder(); - getStatusFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (specBuilder_ == null) { - spec_ = null; - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - if (statusBuilder_ == null) { - status_ = null; - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJob build() { - io.kubernetes.client.proto.V2alpha1Batch.CronJob result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJob buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.CronJob result = - new io.kubernetes.client.proto.V2alpha1Batch.CronJob(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (specBuilder_ == null) { - result.spec_ = spec_; - } else { - result.spec_ = specBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJob) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJob) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJob other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.hasSpec()) { - mergeSpec(other.getSpec()); - } - if (other.hasStatus()) { - mergeStatus(other.getStatus()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.CronJob parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.CronJob) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec spec_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder> - specBuilder_; - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getSpec() { - if (specBuilder_ == null) { - return spec_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() - : spec_; - } else { - return specBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public Builder setSpec(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec value) { - if (specBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - spec_ = value; - onChanged(); - } else { - specBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public Builder setSpec( - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder builderForValue) { - if (specBuilder_ == null) { - spec_ = builderForValue.build(); - onChanged(); - } else { - specBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public Builder mergeSpec(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec value) { - if (specBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && spec_ != null - && spec_ - != io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance()) { - spec_ = - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.newBuilder(spec_) - .mergeFrom(value) - .buildPartial(); - } else { - spec_ = value; - } - onChanged(); - } else { - specBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public Builder clearSpec() { - if (specBuilder_ == null) { - spec_ = null; - onChanged(); - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder getSpecBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder getSpecOrBuilder() { - if (specBuilder_ != null) { - return specBuilder_.getMessageOrBuilder(); - } else { - return spec_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance() - : spec_; - } - } - /** - * - * - *
-       * Specification of the desired behavior of a cron job, including the schedule.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobSpec spec = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder> - getSpecFieldBuilder() { - if (specBuilder_ == null) { - specBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder>( - getSpec(), getParentForChildren(), isClean()); - spec_ = null; - } - return specBuilder_; - } - - private io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus status_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder> - statusBuilder_; - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getStatus() { - if (statusBuilder_ == null) { - return status_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() - : status_; - } else { - return statusBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public Builder setStatus(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus value) { - if (statusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - status_ = value; - onChanged(); - } else { - statusBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public Builder setStatus( - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder builderForValue) { - if (statusBuilder_ == null) { - status_ = builderForValue.build(); - onChanged(); - } else { - statusBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public Builder mergeStatus(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus value) { - if (statusBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004) - && status_ != null - && status_ - != io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance()) { - status_ = - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.newBuilder(status_) - .mergeFrom(value) - .buildPartial(); - } else { - status_ = value; - } - onChanged(); - } else { - statusBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - statusBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder getStatusBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getStatusFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder getStatusOrBuilder() { - if (statusBuilder_ != null) { - return statusBuilder_.getMessageOrBuilder(); - } else { - return status_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance() - : status_; - } - } - /** - * - * - *
-       * Current status of a cron job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.CronJobStatus status = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder> - getStatusFieldBuilder() { - if (statusBuilder_ == null) { - statusBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder>( - getStatus(), getParentForChildren(), isClean()); - status_ = null; - } - return statusBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJob) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJob) - private static final io.kubernetes.client.proto.V2alpha1Batch.CronJob DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJob(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CronJob parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CronJob(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJob getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CronJobListOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobList) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMeta getMetadata(); - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - java.util.List getItemsList(); - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index); - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - int getItemsCount(); - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - java.util.List - getItemsOrBuilderList(); - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder(int index); - } - /** - * - * - *
-   * CronJobList is a collection of cron jobs.
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobList} - */ - public static final class CronJobList extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobList) - CronJobListOrBuilder { - private static final long serialVersionUID = 0L; - // Use CronJobList.newBuilder() to construct. - private CronJobList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CronJobList() { - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CronJobList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ListMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ListMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - items_.add( - input.readMessage( - io.kubernetes.client.proto.V2alpha1Batch.CronJob.PARSER, - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobList.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobList.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ListMeta metadata_; - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard list metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - - public static final int ITEMS_FIELD_NUMBER = 2; - private java.util.List items_; - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public java.util.List getItemsList() { - return items_; - } - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public java.util.List - getItemsOrBuilderList() { - return items_; - } - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public int getItemsCount() { - return items_.size(); - } - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index) { - return items_.get(index); - } - /** - * - * - *
-     * items is the list of CronJobs.
-     * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder(int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(2, items_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobList)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.CronJobList other = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobList) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && getItemsList().equals(other.getItemsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V2alpha1Batch.CronJobList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * CronJobList is a collection of cron jobs.
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobList} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobList) - io.kubernetes.client.proto.V2alpha1Batch.CronJobListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobList.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobList.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getItemsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - itemsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.CronJobList.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobList build() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobList buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobList result = - new io.kubernetes.client.proto.V2alpha1Batch.CronJobList(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobList) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobList) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobList other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobList.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000002); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getItemsFieldBuilder() - : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.CronJobList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ListMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ListMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ListMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ListMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ListMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ListMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard list metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ListMeta, - io.kubernetes.client.proto.Meta.ListMeta.Builder, - io.kubernetes.client.proto.Meta.ListMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.util.List items_ = - java.util.Collections.emptyList(); - - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - items_ = - new java.util.ArrayList(items_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJob, - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder> - itemsBuilder_; - - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public java.util.List getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJob getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder setItems(int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder setItems( - int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder addItems(io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder addItems(int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder addItems( - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder addItems( - int index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder addAllItems( - java.lang.Iterable values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder getItemsBuilder(int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder getItemsOrBuilder( - int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public java.util.List - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder addItemsBuilder() { - return getItemsFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()); - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder addItemsBuilder(int index) { - return getItemsFieldBuilder() - .addBuilder( - index, io.kubernetes.client.proto.V2alpha1Batch.CronJob.getDefaultInstance()); - } - /** - * - * - *
-       * items is the list of CronJobs.
-       * 
- * - * repeated .k8s.io.api.batch.v2alpha1.CronJob items = 2; - */ - public java.util.List - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJob, - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.CronJob, - io.kubernetes.client.proto.V2alpha1Batch.CronJob.Builder, - io.kubernetes.client.proto.V2alpha1Batch.CronJobOrBuilder>( - items_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobList) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobList) - private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobList DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobList(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CronJobList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CronJobList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CronJobSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - boolean hasSchedule(); - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - java.lang.String getSchedule(); - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - com.google.protobuf.ByteString getScheduleBytes(); - - /** - * - * - *
-     * Optional deadline in seconds for starting the job if it misses scheduled
-     * time for any reason.  Missed jobs executions will be counted as failed ones.
-     * +optional
-     * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - boolean hasStartingDeadlineSeconds(); - /** - * - * - *
-     * Optional deadline in seconds for starting the job if it misses scheduled
-     * time for any reason.  Missed jobs executions will be counted as failed ones.
-     * +optional
-     * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - long getStartingDeadlineSeconds(); - - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - boolean hasConcurrencyPolicy(); - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - java.lang.String getConcurrencyPolicy(); - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - com.google.protobuf.ByteString getConcurrencyPolicyBytes(); - - /** - * - * - *
-     * This flag tells the controller to suspend subsequent executions, it does
-     * not apply to already started executions.  Defaults to false.
-     * +optional
-     * 
- * - * optional bool suspend = 4; - */ - boolean hasSuspend(); - /** - * - * - *
-     * This flag tells the controller to suspend subsequent executions, it does
-     * not apply to already started executions.  Defaults to false.
-     * +optional
-     * 
- * - * optional bool suspend = 4; - */ - boolean getSuspend(); - - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - boolean hasJobTemplate(); - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate(); - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder getJobTemplateOrBuilder(); - - /** - * - * - *
-     * The number of successful finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - boolean hasSuccessfulJobsHistoryLimit(); - /** - * - * - *
-     * The number of successful finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - int getSuccessfulJobsHistoryLimit(); - - /** - * - * - *
-     * The number of failed finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - boolean hasFailedJobsHistoryLimit(); - /** - * - * - *
-     * The number of failed finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - int getFailedJobsHistoryLimit(); - } - /** - * - * - *
-   * CronJobSpec describes how the job execution will look like and when it will actually run.
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobSpec} - */ - public static final class CronJobSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobSpec) - CronJobSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use CronJobSpec.newBuilder() to construct. - private CronJobSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CronJobSpec() { - schedule_ = ""; - startingDeadlineSeconds_ = 0L; - concurrencyPolicy_ = ""; - suspend_ = false; - successfulJobsHistoryLimit_ = 0; - failedJobsHistoryLimit_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CronJobSpec( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - schedule_ = bs; - break; - } - case 16: - { - bitField0_ |= 0x00000002; - startingDeadlineSeconds_ = input.readInt64(); - break; - } - case 26: - { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - concurrencyPolicy_ = bs; - break; - } - case 32: - { - bitField0_ |= 0x00000008; - suspend_ = input.readBool(); - break; - } - case 42: - { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = jobTemplate_.toBuilder(); - } - jobTemplate_ = - input.readMessage( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(jobTemplate_); - jobTemplate_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 48: - { - bitField0_ |= 0x00000020; - successfulJobsHistoryLimit_ = input.readInt32(); - break; - } - case 56: - { - bitField0_ |= 0x00000040; - failedJobsHistoryLimit_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder.class); - } - - private int bitField0_; - public static final int SCHEDULE_FIELD_NUMBER = 1; - private volatile java.lang.Object schedule_; - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - public boolean hasSchedule() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - public java.lang.String getSchedule() { - java.lang.Object ref = schedule_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schedule_ = s; - } - return s; - } - } - /** - * - * - *
-     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-     * 
- * - * optional string schedule = 1; - */ - public com.google.protobuf.ByteString getScheduleBytes() { - java.lang.Object ref = schedule_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - schedule_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STARTINGDEADLINESECONDS_FIELD_NUMBER = 2; - private long startingDeadlineSeconds_; - /** - * - * - *
-     * Optional deadline in seconds for starting the job if it misses scheduled
-     * time for any reason.  Missed jobs executions will be counted as failed ones.
-     * +optional
-     * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public boolean hasStartingDeadlineSeconds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Optional deadline in seconds for starting the job if it misses scheduled
-     * time for any reason.  Missed jobs executions will be counted as failed ones.
-     * +optional
-     * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public long getStartingDeadlineSeconds() { - return startingDeadlineSeconds_; - } - - public static final int CONCURRENCYPOLICY_FIELD_NUMBER = 3; - private volatile java.lang.Object concurrencyPolicy_; - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - public boolean hasConcurrencyPolicy() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - public java.lang.String getConcurrencyPolicy() { - java.lang.Object ref = concurrencyPolicy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - concurrencyPolicy_ = s; - } - return s; - } - } - /** - * - * - *
-     * Specifies how to treat concurrent executions of a Job.
-     * Valid values are:
-     * - "Allow" (default): allows CronJobs to run concurrently;
-     * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-     * - "Replace": cancels currently running job and replaces it with a new one
-     * +optional
-     * 
- * - * optional string concurrencyPolicy = 3; - */ - public com.google.protobuf.ByteString getConcurrencyPolicyBytes() { - java.lang.Object ref = concurrencyPolicy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - concurrencyPolicy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUSPEND_FIELD_NUMBER = 4; - private boolean suspend_; - /** - * - * - *
-     * This flag tells the controller to suspend subsequent executions, it does
-     * not apply to already started executions.  Defaults to false.
-     * +optional
-     * 
- * - * optional bool suspend = 4; - */ - public boolean hasSuspend() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * - * - *
-     * This flag tells the controller to suspend subsequent executions, it does
-     * not apply to already started executions.  Defaults to false.
-     * +optional
-     * 
- * - * optional bool suspend = 4; - */ - public boolean getSuspend() { - return suspend_; - } - - public static final int JOBTEMPLATE_FIELD_NUMBER = 5; - private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec jobTemplate_; - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public boolean hasJobTemplate() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate() { - return jobTemplate_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : jobTemplate_; - } - /** - * - * - *
-     * Specifies the job that will be created when executing a CronJob.
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder - getJobTemplateOrBuilder() { - return jobTemplate_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : jobTemplate_; - } - - public static final int SUCCESSFULJOBSHISTORYLIMIT_FIELD_NUMBER = 6; - private int successfulJobsHistoryLimit_; - /** - * - * - *
-     * The number of successful finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public boolean hasSuccessfulJobsHistoryLimit() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * - * - *
-     * The number of successful finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public int getSuccessfulJobsHistoryLimit() { - return successfulJobsHistoryLimit_; - } - - public static final int FAILEDJOBSHISTORYLIMIT_FIELD_NUMBER = 7; - private int failedJobsHistoryLimit_; - /** - * - * - *
-     * The number of failed finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public boolean hasFailedJobsHistoryLimit() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * - * - *
-     * The number of failed finished jobs to retain.
-     * This is a pointer to distinguish between explicit zero and not specified.
-     * +optional
-     * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public int getFailedJobsHistoryLimit() { - return failedJobsHistoryLimit_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schedule_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, startingDeadlineSeconds_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, concurrencyPolicy_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBool(4, suspend_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(5, getJobTemplate()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(6, successfulJobsHistoryLimit_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(7, failedJobsHistoryLimit_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schedule_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, startingDeadlineSeconds_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, concurrencyPolicy_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, suspend_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getJobTemplate()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += - com.google.protobuf.CodedOutputStream.computeInt32Size(6, successfulJobsHistoryLimit_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, failedJobsHistoryLimit_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec other = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) obj; - - boolean result = true; - result = result && (hasSchedule() == other.hasSchedule()); - if (hasSchedule()) { - result = result && getSchedule().equals(other.getSchedule()); - } - result = result && (hasStartingDeadlineSeconds() == other.hasStartingDeadlineSeconds()); - if (hasStartingDeadlineSeconds()) { - result = result && (getStartingDeadlineSeconds() == other.getStartingDeadlineSeconds()); - } - result = result && (hasConcurrencyPolicy() == other.hasConcurrencyPolicy()); - if (hasConcurrencyPolicy()) { - result = result && getConcurrencyPolicy().equals(other.getConcurrencyPolicy()); - } - result = result && (hasSuspend() == other.hasSuspend()); - if (hasSuspend()) { - result = result && (getSuspend() == other.getSuspend()); - } - result = result && (hasJobTemplate() == other.hasJobTemplate()); - if (hasJobTemplate()) { - result = result && getJobTemplate().equals(other.getJobTemplate()); - } - result = result && (hasSuccessfulJobsHistoryLimit() == other.hasSuccessfulJobsHistoryLimit()); - if (hasSuccessfulJobsHistoryLimit()) { - result = - result && (getSuccessfulJobsHistoryLimit() == other.getSuccessfulJobsHistoryLimit()); - } - result = result && (hasFailedJobsHistoryLimit() == other.hasFailedJobsHistoryLimit()); - if (hasFailedJobsHistoryLimit()) { - result = result && (getFailedJobsHistoryLimit() == other.getFailedJobsHistoryLimit()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSchedule()) { - hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; - hash = (53 * hash) + getSchedule().hashCode(); - } - if (hasStartingDeadlineSeconds()) { - hash = (37 * hash) + STARTINGDEADLINESECONDS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStartingDeadlineSeconds()); - } - if (hasConcurrencyPolicy()) { - hash = (37 * hash) + CONCURRENCYPOLICY_FIELD_NUMBER; - hash = (53 * hash) + getConcurrencyPolicy().hashCode(); - } - if (hasSuspend()) { - hash = (37 * hash) + SUSPEND_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSuspend()); - } - if (hasJobTemplate()) { - hash = (37 * hash) + JOBTEMPLATE_FIELD_NUMBER; - hash = (53 * hash) + getJobTemplate().hashCode(); - } - if (hasSuccessfulJobsHistoryLimit()) { - hash = (37 * hash) + SUCCESSFULJOBSHISTORYLIMIT_FIELD_NUMBER; - hash = (53 * hash) + getSuccessfulJobsHistoryLimit(); - } - if (hasFailedJobsHistoryLimit()) { - hash = (37 * hash) + FAILEDJOBSHISTORYLIMIT_FIELD_NUMBER; - hash = (53 * hash) + getFailedJobsHistoryLimit(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * CronJobSpec describes how the job execution will look like and when it will actually run.
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobSpec) - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getJobTemplateFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - schedule_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - startingDeadlineSeconds_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - concurrencyPolicy_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - suspend_ = false; - bitField0_ = (bitField0_ & ~0x00000008); - if (jobTemplateBuilder_ == null) { - jobTemplate_ = null; - } else { - jobTemplateBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - successfulJobsHistoryLimit_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); - failedJobsHistoryLimit_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec build() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec result = - new io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.schedule_ = schedule_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.startingDeadlineSeconds_ = startingDeadlineSeconds_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.concurrencyPolicy_ = concurrencyPolicy_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.suspend_ = suspend_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - if (jobTemplateBuilder_ == null) { - result.jobTemplate_ = jobTemplate_; - } else { - result.jobTemplate_ = jobTemplateBuilder_.build(); - } - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.successfulJobsHistoryLimit_ = successfulJobsHistoryLimit_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.failedJobsHistoryLimit_ = failedJobsHistoryLimit_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec.getDefaultInstance()) - return this; - if (other.hasSchedule()) { - bitField0_ |= 0x00000001; - schedule_ = other.schedule_; - onChanged(); - } - if (other.hasStartingDeadlineSeconds()) { - setStartingDeadlineSeconds(other.getStartingDeadlineSeconds()); - } - if (other.hasConcurrencyPolicy()) { - bitField0_ |= 0x00000004; - concurrencyPolicy_ = other.concurrencyPolicy_; - onChanged(); - } - if (other.hasSuspend()) { - setSuspend(other.getSuspend()); - } - if (other.hasJobTemplate()) { - mergeJobTemplate(other.getJobTemplate()); - } - if (other.hasSuccessfulJobsHistoryLimit()) { - setSuccessfulJobsHistoryLimit(other.getSuccessfulJobsHistoryLimit()); - } - if (other.hasFailedJobsHistoryLimit()) { - setFailedJobsHistoryLimit(other.getFailedJobsHistoryLimit()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object schedule_ = ""; - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public boolean hasSchedule() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public java.lang.String getSchedule() { - java.lang.Object ref = schedule_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schedule_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public com.google.protobuf.ByteString getScheduleBytes() { - java.lang.Object ref = schedule_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - schedule_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public Builder setSchedule(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - schedule_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public Builder clearSchedule() { - bitField0_ = (bitField0_ & ~0x00000001); - schedule_ = getDefaultInstance().getSchedule(); - onChanged(); - return this; - } - /** - * - * - *
-       * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
-       * 
- * - * optional string schedule = 1; - */ - public Builder setScheduleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - schedule_ = value; - onChanged(); - return this; - } - - private long startingDeadlineSeconds_; - /** - * - * - *
-       * Optional deadline in seconds for starting the job if it misses scheduled
-       * time for any reason.  Missed jobs executions will be counted as failed ones.
-       * +optional
-       * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public boolean hasStartingDeadlineSeconds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Optional deadline in seconds for starting the job if it misses scheduled
-       * time for any reason.  Missed jobs executions will be counted as failed ones.
-       * +optional
-       * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public long getStartingDeadlineSeconds() { - return startingDeadlineSeconds_; - } - /** - * - * - *
-       * Optional deadline in seconds for starting the job if it misses scheduled
-       * time for any reason.  Missed jobs executions will be counted as failed ones.
-       * +optional
-       * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public Builder setStartingDeadlineSeconds(long value) { - bitField0_ |= 0x00000002; - startingDeadlineSeconds_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional deadline in seconds for starting the job if it misses scheduled
-       * time for any reason.  Missed jobs executions will be counted as failed ones.
-       * +optional
-       * 
- * - * optional int64 startingDeadlineSeconds = 2; - */ - public Builder clearStartingDeadlineSeconds() { - bitField0_ = (bitField0_ & ~0x00000002); - startingDeadlineSeconds_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object concurrencyPolicy_ = ""; - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public boolean hasConcurrencyPolicy() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public java.lang.String getConcurrencyPolicy() { - java.lang.Object ref = concurrencyPolicy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - concurrencyPolicy_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public com.google.protobuf.ByteString getConcurrencyPolicyBytes() { - java.lang.Object ref = concurrencyPolicy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - concurrencyPolicy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public Builder setConcurrencyPolicy(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - concurrencyPolicy_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public Builder clearConcurrencyPolicy() { - bitField0_ = (bitField0_ & ~0x00000004); - concurrencyPolicy_ = getDefaultInstance().getConcurrencyPolicy(); - onChanged(); - return this; - } - /** - * - * - *
-       * Specifies how to treat concurrent executions of a Job.
-       * Valid values are:
-       * - "Allow" (default): allows CronJobs to run concurrently;
-       * - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
-       * - "Replace": cancels currently running job and replaces it with a new one
-       * +optional
-       * 
- * - * optional string concurrencyPolicy = 3; - */ - public Builder setConcurrencyPolicyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - concurrencyPolicy_ = value; - onChanged(); - return this; - } - - private boolean suspend_; - /** - * - * - *
-       * This flag tells the controller to suspend subsequent executions, it does
-       * not apply to already started executions.  Defaults to false.
-       * +optional
-       * 
- * - * optional bool suspend = 4; - */ - public boolean hasSuspend() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * - * - *
-       * This flag tells the controller to suspend subsequent executions, it does
-       * not apply to already started executions.  Defaults to false.
-       * +optional
-       * 
- * - * optional bool suspend = 4; - */ - public boolean getSuspend() { - return suspend_; - } - /** - * - * - *
-       * This flag tells the controller to suspend subsequent executions, it does
-       * not apply to already started executions.  Defaults to false.
-       * +optional
-       * 
- * - * optional bool suspend = 4; - */ - public Builder setSuspend(boolean value) { - bitField0_ |= 0x00000008; - suspend_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * This flag tells the controller to suspend subsequent executions, it does
-       * not apply to already started executions.  Defaults to false.
-       * +optional
-       * 
- * - * optional bool suspend = 4; - */ - public Builder clearSuspend() { - bitField0_ = (bitField0_ & ~0x00000008); - suspend_ = false; - onChanged(); - return this; - } - - private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec jobTemplate_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> - jobTemplateBuilder_; - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public boolean hasJobTemplate() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getJobTemplate() { - if (jobTemplateBuilder_ == null) { - return jobTemplate_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : jobTemplate_; - } else { - return jobTemplateBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public Builder setJobTemplate( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { - if (jobTemplateBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - jobTemplate_ = value; - onChanged(); - } else { - jobTemplateBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public Builder setJobTemplate( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder builderForValue) { - if (jobTemplateBuilder_ == null) { - jobTemplate_ = builderForValue.build(); - onChanged(); - } else { - jobTemplateBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public Builder mergeJobTemplate( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { - if (jobTemplateBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010) - && jobTemplate_ != null - && jobTemplate_ - != io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec - .getDefaultInstance()) { - jobTemplate_ = - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder(jobTemplate_) - .mergeFrom(value) - .buildPartial(); - } else { - jobTemplate_ = value; - } - onChanged(); - } else { - jobTemplateBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public Builder clearJobTemplate() { - if (jobTemplateBuilder_ == null) { - jobTemplate_ = null; - onChanged(); - } else { - jobTemplateBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder - getJobTemplateBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getJobTemplateFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder - getJobTemplateOrBuilder() { - if (jobTemplateBuilder_ != null) { - return jobTemplateBuilder_.getMessageOrBuilder(); - } else { - return jobTemplate_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : jobTemplate_; - } - } - /** - * - * - *
-       * Specifies the job that will be created when executing a CronJob.
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec jobTemplate = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> - getJobTemplateFieldBuilder() { - if (jobTemplateBuilder_ == null) { - jobTemplateBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder>( - getJobTemplate(), getParentForChildren(), isClean()); - jobTemplate_ = null; - } - return jobTemplateBuilder_; - } - - private int successfulJobsHistoryLimit_; - /** - * - * - *
-       * The number of successful finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public boolean hasSuccessfulJobsHistoryLimit() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * - * - *
-       * The number of successful finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public int getSuccessfulJobsHistoryLimit() { - return successfulJobsHistoryLimit_; - } - /** - * - * - *
-       * The number of successful finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public Builder setSuccessfulJobsHistoryLimit(int value) { - bitField0_ |= 0x00000020; - successfulJobsHistoryLimit_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The number of successful finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 successfulJobsHistoryLimit = 6; - */ - public Builder clearSuccessfulJobsHistoryLimit() { - bitField0_ = (bitField0_ & ~0x00000020); - successfulJobsHistoryLimit_ = 0; - onChanged(); - return this; - } - - private int failedJobsHistoryLimit_; - /** - * - * - *
-       * The number of failed finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public boolean hasFailedJobsHistoryLimit() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * - * - *
-       * The number of failed finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public int getFailedJobsHistoryLimit() { - return failedJobsHistoryLimit_; - } - /** - * - * - *
-       * The number of failed finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public Builder setFailedJobsHistoryLimit(int value) { - bitField0_ |= 0x00000040; - failedJobsHistoryLimit_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The number of failed finished jobs to retain.
-       * This is a pointer to distinguish between explicit zero and not specified.
-       * +optional
-       * 
- * - * optional int32 failedJobsHistoryLimit = 7; - */ - public Builder clearFailedJobsHistoryLimit() { - bitField0_ = (bitField0_ & ~0x00000040); - failedJobsHistoryLimit_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobSpec) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobSpec) - private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CronJobSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CronJobSpec(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobSpec getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CronJobStatusOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.CronJobStatus) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - java.util.List getActiveList(); - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - io.kubernetes.client.proto.V1.ObjectReference getActive(int index); - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - int getActiveCount(); - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - java.util.List - getActiveOrBuilderList(); - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index); - - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - boolean hasLastScheduleTime(); - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - io.kubernetes.client.proto.Meta.Time getLastScheduleTime(); - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder(); - } - /** - * - * - *
-   * CronJobStatus represents the current state of a cron job.
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobStatus} - */ - public static final class CronJobStatus extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.CronJobStatus) - CronJobStatusOrBuilder { - private static final long serialVersionUID = 0L; - // Use CronJobStatus.newBuilder() to construct. - private CronJobStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CronJobStatus() { - active_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CronJobStatus( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - active_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - active_.add( - input.readMessage( - io.kubernetes.client.proto.V1.ObjectReference.PARSER, extensionRegistry)); - break; - } - case 34: - { - io.kubernetes.client.proto.Meta.Time.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = lastScheduleTime_.toBuilder(); - } - lastScheduleTime_ = - input.readMessage( - io.kubernetes.client.proto.Meta.Time.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastScheduleTime_); - lastScheduleTime_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - active_ = java.util.Collections.unmodifiableList(active_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder.class); - } - - private int bitField0_; - public static final int ACTIVE_FIELD_NUMBER = 1; - private java.util.List active_; - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public java.util.List getActiveList() { - return active_; - } - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public java.util.List - getActiveOrBuilderList() { - return active_; - } - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public int getActiveCount() { - return active_.size(); - } - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReference getActive(int index) { - return active_.get(index); - } - /** - * - * - *
-     * A list of pointers to currently running jobs.
-     * +optional
-     * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index) { - return active_.get(index); - } - - public static final int LASTSCHEDULETIME_FIELD_NUMBER = 4; - private io.kubernetes.client.proto.Meta.Time lastScheduleTime_; - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - public boolean hasLastScheduleTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - public io.kubernetes.client.proto.Meta.Time getLastScheduleTime() { - return lastScheduleTime_ == null - ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() - : lastScheduleTime_; - } - /** - * - * - *
-     * Information when was the last time the job was successfully scheduled.
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - */ - public io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder() { - return lastScheduleTime_ == null - ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() - : lastScheduleTime_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < active_.size(); i++) { - output.writeMessage(1, active_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(4, getLastScheduleTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < active_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, active_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getLastScheduleTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus other = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) obj; - - boolean result = true; - result = result && getActiveList().equals(other.getActiveList()); - result = result && (hasLastScheduleTime() == other.hasLastScheduleTime()); - if (hasLastScheduleTime()) { - result = result && getLastScheduleTime().equals(other.getLastScheduleTime()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getActiveCount() > 0) { - hash = (37 * hash) + ACTIVE_FIELD_NUMBER; - hash = (53 * hash) + getActiveList().hashCode(); - } - if (hasLastScheduleTime()) { - hash = (37 * hash) + LASTSCHEDULETIME_FIELD_NUMBER; - hash = (53 * hash) + getLastScheduleTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * CronJobStatus represents the current state of a cron job.
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.CronJobStatus} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.CronJobStatus) - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatusOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.class, - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getActiveFieldBuilder(); - getLastScheduleTimeFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (activeBuilder_ == null) { - active_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - activeBuilder_.clear(); - } - if (lastScheduleTimeBuilder_ == null) { - lastScheduleTime_ = null; - } else { - lastScheduleTimeBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus build() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus result = - new io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (activeBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - active_ = java.util.Collections.unmodifiableList(active_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.active_ = active_; - } else { - result.active_ = activeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000001; - } - if (lastScheduleTimeBuilder_ == null) { - result.lastScheduleTime_ = lastScheduleTime_; - } else { - result.lastScheduleTime_ = lastScheduleTimeBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus.getDefaultInstance()) - return this; - if (activeBuilder_ == null) { - if (!other.active_.isEmpty()) { - if (active_.isEmpty()) { - active_ = other.active_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureActiveIsMutable(); - active_.addAll(other.active_); - } - onChanged(); - } - } else { - if (!other.active_.isEmpty()) { - if (activeBuilder_.isEmpty()) { - activeBuilder_.dispose(); - activeBuilder_ = null; - active_ = other.active_; - bitField0_ = (bitField0_ & ~0x00000001); - activeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getActiveFieldBuilder() - : null; - } else { - activeBuilder_.addAllMessages(other.active_); - } - } - } - if (other.hasLastScheduleTime()) { - mergeLastScheduleTime(other.getLastScheduleTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List active_ = - java.util.Collections.emptyList(); - - private void ensureActiveIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - active_ = new java.util.ArrayList(active_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.ObjectReference, - io.kubernetes.client.proto.V1.ObjectReference.Builder, - io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder> - activeBuilder_; - - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public java.util.List getActiveList() { - if (activeBuilder_ == null) { - return java.util.Collections.unmodifiableList(active_); - } else { - return activeBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public int getActiveCount() { - if (activeBuilder_ == null) { - return active_.size(); - } else { - return activeBuilder_.getCount(); - } - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReference getActive(int index) { - if (activeBuilder_ == null) { - return active_.get(index); - } else { - return activeBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder setActive(int index, io.kubernetes.client.proto.V1.ObjectReference value) { - if (activeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureActiveIsMutable(); - active_.set(index, value); - onChanged(); - } else { - activeBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder setActive( - int index, io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { - if (activeBuilder_ == null) { - ensureActiveIsMutable(); - active_.set(index, builderForValue.build()); - onChanged(); - } else { - activeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder addActive(io.kubernetes.client.proto.V1.ObjectReference value) { - if (activeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureActiveIsMutable(); - active_.add(value); - onChanged(); - } else { - activeBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder addActive(int index, io.kubernetes.client.proto.V1.ObjectReference value) { - if (activeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureActiveIsMutable(); - active_.add(index, value); - onChanged(); - } else { - activeBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder addActive( - io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { - if (activeBuilder_ == null) { - ensureActiveIsMutable(); - active_.add(builderForValue.build()); - onChanged(); - } else { - activeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder addActive( - int index, io.kubernetes.client.proto.V1.ObjectReference.Builder builderForValue) { - if (activeBuilder_ == null) { - ensureActiveIsMutable(); - active_.add(index, builderForValue.build()); - onChanged(); - } else { - activeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder addAllActive( - java.lang.Iterable values) { - if (activeBuilder_ == null) { - ensureActiveIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, active_); - onChanged(); - } else { - activeBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder clearActive() { - if (activeBuilder_ == null) { - active_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - activeBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public Builder removeActive(int index) { - if (activeBuilder_ == null) { - ensureActiveIsMutable(); - active_.remove(index); - onChanged(); - } else { - activeBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReference.Builder getActiveBuilder(int index) { - return getActiveFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder getActiveOrBuilder(int index) { - if (activeBuilder_ == null) { - return active_.get(index); - } else { - return activeBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public java.util.List - getActiveOrBuilderList() { - if (activeBuilder_ != null) { - return activeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(active_); - } - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReference.Builder addActiveBuilder() { - return getActiveFieldBuilder() - .addBuilder(io.kubernetes.client.proto.V1.ObjectReference.getDefaultInstance()); - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public io.kubernetes.client.proto.V1.ObjectReference.Builder addActiveBuilder(int index) { - return getActiveFieldBuilder() - .addBuilder(index, io.kubernetes.client.proto.V1.ObjectReference.getDefaultInstance()); - } - /** - * - * - *
-       * A list of pointers to currently running jobs.
-       * +optional
-       * 
- * - * repeated .k8s.io.api.core.v1.ObjectReference active = 1; - */ - public java.util.List - getActiveBuilderList() { - return getActiveFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.ObjectReference, - io.kubernetes.client.proto.V1.ObjectReference.Builder, - io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder> - getActiveFieldBuilder() { - if (activeBuilder_ == null) { - activeBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - io.kubernetes.client.proto.V1.ObjectReference, - io.kubernetes.client.proto.V1.ObjectReference.Builder, - io.kubernetes.client.proto.V1.ObjectReferenceOrBuilder>( - active_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - active_ = null; - } - return activeBuilder_; - } - - private io.kubernetes.client.proto.Meta.Time lastScheduleTime_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Time, - io.kubernetes.client.proto.Meta.Time.Builder, - io.kubernetes.client.proto.Meta.TimeOrBuilder> - lastScheduleTimeBuilder_; - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public boolean hasLastScheduleTime() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public io.kubernetes.client.proto.Meta.Time getLastScheduleTime() { - if (lastScheduleTimeBuilder_ == null) { - return lastScheduleTime_ == null - ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() - : lastScheduleTime_; - } else { - return lastScheduleTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public Builder setLastScheduleTime(io.kubernetes.client.proto.Meta.Time value) { - if (lastScheduleTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastScheduleTime_ = value; - onChanged(); - } else { - lastScheduleTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public Builder setLastScheduleTime( - io.kubernetes.client.proto.Meta.Time.Builder builderForValue) { - if (lastScheduleTimeBuilder_ == null) { - lastScheduleTime_ = builderForValue.build(); - onChanged(); - } else { - lastScheduleTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public Builder mergeLastScheduleTime(io.kubernetes.client.proto.Meta.Time value) { - if (lastScheduleTimeBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && lastScheduleTime_ != null - && lastScheduleTime_ != io.kubernetes.client.proto.Meta.Time.getDefaultInstance()) { - lastScheduleTime_ = - io.kubernetes.client.proto.Meta.Time.newBuilder(lastScheduleTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lastScheduleTime_ = value; - } - onChanged(); - } else { - lastScheduleTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public Builder clearLastScheduleTime() { - if (lastScheduleTimeBuilder_ == null) { - lastScheduleTime_ = null; - onChanged(); - } else { - lastScheduleTimeBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public io.kubernetes.client.proto.Meta.Time.Builder getLastScheduleTimeBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getLastScheduleTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - public io.kubernetes.client.proto.Meta.TimeOrBuilder getLastScheduleTimeOrBuilder() { - if (lastScheduleTimeBuilder_ != null) { - return lastScheduleTimeBuilder_.getMessageOrBuilder(); - } else { - return lastScheduleTime_ == null - ? io.kubernetes.client.proto.Meta.Time.getDefaultInstance() - : lastScheduleTime_; - } - } - /** - * - * - *
-       * Information when was the last time the job was successfully scheduled.
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Time, - io.kubernetes.client.proto.Meta.Time.Builder, - io.kubernetes.client.proto.Meta.TimeOrBuilder> - getLastScheduleTimeFieldBuilder() { - if (lastScheduleTimeBuilder_ == null) { - lastScheduleTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.Time, - io.kubernetes.client.proto.Meta.Time.Builder, - io.kubernetes.client.proto.Meta.TimeOrBuilder>( - getLastScheduleTime(), getParentForChildren(), isClean()); - lastScheduleTime_ = null; - } - return lastScheduleTimeBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.CronJobStatus) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.CronJobStatus) - private static final io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CronJobStatus parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CronJobStatus(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.CronJobStatus getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface JobTemplateOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.JobTemplate) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - boolean hasTemplate(); - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate(); - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder getTemplateOrBuilder(); - } - /** - * - * - *
-   * JobTemplate describes a template for creating copies of a predefined pod.
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplate} - */ - public static final class JobTemplate extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.JobTemplate) - JobTemplateOrBuilder { - private static final long serialVersionUID = 0L; - // Use JobTemplate.newBuilder() to construct. - private JobTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private JobTemplate() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private JobTemplate( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = template_.toBuilder(); - } - template_ = - input.readMessage( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.PARSER, - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(template_); - template_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.class, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard object's metadata.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int TEMPLATE_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec template_; - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public boolean hasTemplate() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate() { - return template_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : template_; - } - /** - * - * - *
-     * Defines jobs that will be created from this template.
-     * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder - getTemplateOrBuilder() { - return template_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : template_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getTemplate()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTemplate()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplate)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate other = - (io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && (hasTemplate() == other.hasTemplate()); - if (hasTemplate()) { - result = result && getTemplate().equals(other.getTemplate()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (hasTemplate()) { - hash = (37 * hash) + TEMPLATE_FIELD_NUMBER; - hash = (53 * hash) + getTemplate().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * JobTemplate describes a template for creating copies of a predefined pod.
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplate} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.JobTemplate) - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.class, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getTemplateFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (templateBuilder_ == null) { - template_ = null; - } else { - templateBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate build() { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate result = - new io.kubernetes.client.proto.V2alpha1Batch.JobTemplate(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (templateBuilder_ == null) { - result.template_ = template_; - } else { - result.template_ = templateBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.JobTemplate other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.JobTemplate.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.hasTemplate()) { - mergeTemplate(other.getTemplate()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplate parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.JobTemplate) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard object's metadata.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec template_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> - templateBuilder_; - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public boolean hasTemplate() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getTemplate() { - if (templateBuilder_ == null) { - return template_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : template_; - } else { - return templateBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public Builder setTemplate(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { - if (templateBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - template_ = value; - onChanged(); - } else { - templateBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public Builder setTemplate( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder builderForValue) { - if (templateBuilder_ == null) { - template_ = builderForValue.build(); - onChanged(); - } else { - templateBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public Builder mergeTemplate(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec value) { - if (templateBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && template_ != null - && template_ - != io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec - .getDefaultInstance()) { - template_ = - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder(template_) - .mergeFrom(value) - .buildPartial(); - } else { - template_ = value; - } - onChanged(); - } else { - templateBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public Builder clearTemplate() { - if (templateBuilder_ == null) { - template_ = null; - onChanged(); - } else { - templateBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder getTemplateBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getTemplateFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder - getTemplateOrBuilder() { - if (templateBuilder_ != null) { - return templateBuilder_.getMessageOrBuilder(); - } else { - return template_ == null - ? io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance() - : template_; - } - } - /** - * - * - *
-       * Defines jobs that will be created from this template.
-       * https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v2alpha1.JobTemplateSpec template = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder> - getTemplateFieldBuilder() { - if (templateBuilder_ == null) { - templateBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder>( - getTemplate(), getParentForChildren(), isClean()); - template_ = null; - } - return templateBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.JobTemplate) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.JobTemplate) - private static final io.kubernetes.client.proto.V2alpha1Batch.JobTemplate DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.JobTemplate(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JobTemplate parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JobTemplate(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplate getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface JobTemplateSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:k8s.io.api.batch.v2alpha1.JobTemplateSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - boolean hasMetadata(); - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMeta getMetadata(); - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - boolean hasSpec(); - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - io.kubernetes.client.proto.V1Batch.JobSpec getSpec(); - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder(); - } - /** - * - * - *
-   * JobTemplateSpec describes the data a Job should have when created from a template
-   * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplateSpec} - */ - public static final class JobTemplateSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:k8s.io.api.batch.v2alpha1.JobTemplateSpec) - JobTemplateSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use JobTemplateSpec.newBuilder() to construct. - private JobTemplateSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private JobTemplateSpec() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private JobTemplateSpec( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - io.kubernetes.client.proto.Meta.ObjectMeta.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - io.kubernetes.client.proto.Meta.ObjectMeta.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: - { - io.kubernetes.client.proto.V1Batch.JobSpec.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = spec_.toBuilder(); - } - spec_ = - input.readMessage( - io.kubernetes.client.proto.V1Batch.JobSpec.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(spec_); - spec_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.class, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder.class); - } - - private int bitField0_; - public static final int METADATA_FIELD_NUMBER = 1; - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_; - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-     * Standard object's metadata of the jobs created from this template.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-     * +optional
-     * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - - public static final int SPEC_FIELD_NUMBER = 2; - private io.kubernetes.client.proto.V1Batch.JobSpec spec_; - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public io.kubernetes.client.proto.V1Batch.JobSpec getSpec() { - return spec_ == null - ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() - : spec_; - } - /** - * - * - *
-     * Specification of the desired behavior of the job.
-     * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-     * +optional
-     * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder() { - return spec_ == null - ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() - : spec_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, getSpec()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpec()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec)) { - return super.equals(obj); - } - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec other = - (io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) obj; - - boolean result = true; - result = result && (hasMetadata() == other.hasMetadata()); - if (hasMetadata()) { - result = result && getMetadata().equals(other.getMetadata()); - } - result = result && (hasSpec() == other.hasSpec()); - if (hasSpec()) { - result = result && getSpec().equals(other.getSpec()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - if (hasSpec()) { - hash = (37 * hash) + SPEC_FIELD_NUMBER; - hash = (53 * hash) + getSpec().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * JobTemplateSpec describes the data a Job should have when created from a template
-     * 
- * - * Protobuf type {@code k8s.io.api.batch.v2alpha1.JobTemplateSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:k8s.io.api.batch.v2alpha1.JobTemplateSpec) - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.class, - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.Builder.class); - } - - // Construct using io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMetadataFieldBuilder(); - getSpecFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (specBuilder_ == null) { - spec_ = null; - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.kubernetes.client.proto.V2alpha1Batch - .internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstanceForType() { - return io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance(); - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec build() { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec buildPartial() { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec result = - new io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (specBuilder_ == null) { - result.spec_ = spec_; - } else { - result.spec_ = specBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) { - return mergeFrom((io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec other) { - if (other == io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec.getDefaultInstance()) - return this; - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.hasSpec()) { - mergeSpec(other.getSpec()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private io.kubernetes.client.proto.Meta.ObjectMeta metadata_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - metadataBuilder_; - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public boolean hasMetadata() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder setMetadata( - io.kubernetes.client.proto.Meta.ObjectMeta.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder mergeMetadata(io.kubernetes.client.proto.Meta.ObjectMeta value) { - if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) - && metadata_ != null - && metadata_ != io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance()) { - metadata_ = - io.kubernetes.client.proto.Meta.ObjectMeta.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMeta.Builder getMetadataBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - public io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? io.kubernetes.client.proto.Meta.ObjectMeta.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-       * Standard object's metadata of the jobs created from this template.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
-       * +optional
-       * 
- * - * optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.Meta.ObjectMeta, - io.kubernetes.client.proto.Meta.ObjectMeta.Builder, - io.kubernetes.client.proto.Meta.ObjectMetaOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private io.kubernetes.client.proto.V1Batch.JobSpec spec_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Batch.JobSpec, - io.kubernetes.client.proto.V1Batch.JobSpec.Builder, - io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder> - specBuilder_; - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public boolean hasSpec() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public io.kubernetes.client.proto.V1Batch.JobSpec getSpec() { - if (specBuilder_ == null) { - return spec_ == null - ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() - : spec_; - } else { - return specBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public Builder setSpec(io.kubernetes.client.proto.V1Batch.JobSpec value) { - if (specBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - spec_ = value; - onChanged(); - } else { - specBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public Builder setSpec(io.kubernetes.client.proto.V1Batch.JobSpec.Builder builderForValue) { - if (specBuilder_ == null) { - spec_ = builderForValue.build(); - onChanged(); - } else { - specBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public Builder mergeSpec(io.kubernetes.client.proto.V1Batch.JobSpec value) { - if (specBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) - && spec_ != null - && spec_ != io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance()) { - spec_ = - io.kubernetes.client.proto.V1Batch.JobSpec.newBuilder(spec_) - .mergeFrom(value) - .buildPartial(); - } else { - spec_ = value; - } - onChanged(); - } else { - specBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public Builder clearSpec() { - if (specBuilder_ == null) { - spec_ = null; - onChanged(); - } else { - specBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public io.kubernetes.client.proto.V1Batch.JobSpec.Builder getSpecBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getSpecFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - public io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder getSpecOrBuilder() { - if (specBuilder_ != null) { - return specBuilder_.getMessageOrBuilder(); - } else { - return spec_ == null - ? io.kubernetes.client.proto.V1Batch.JobSpec.getDefaultInstance() - : spec_; - } - } - /** - * - * - *
-       * Specification of the desired behavior of the job.
-       * More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
-       * +optional
-       * 
- * - * optional .k8s.io.api.batch.v1.JobSpec spec = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Batch.JobSpec, - io.kubernetes.client.proto.V1Batch.JobSpec.Builder, - io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder> - getSpecFieldBuilder() { - if (specBuilder_ == null) { - specBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.kubernetes.client.proto.V1Batch.JobSpec, - io.kubernetes.client.proto.V1Batch.JobSpec.Builder, - io.kubernetes.client.proto.V1Batch.JobSpecOrBuilder>( - getSpec(), getParentForChildren(), isClean()); - spec_ = null; - } - return specBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:k8s.io.api.batch.v2alpha1.JobTemplateSpec) - } - - // @@protoc_insertion_point(class_scope:k8s.io.api.batch.v2alpha1.JobTemplateSpec) - private static final io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec(); - } - - public static io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JobTemplateSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JobTemplateSpec(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.kubernetes.client.proto.V2alpha1Batch.JobTemplateSpec getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n)k8s.io/api/batch/v2alpha1/generated.pr" - + "oto\022\031k8s.io.api.batch.v2alpha1\032#k8s.io/a" - + "pi/batch/v1/generated.proto\032\"k8s.io/api/" - + "core/v1/generated.proto\0324k8s.io/apimachi" - + "nery/pkg/apis/meta/v1/generated.proto\032/k" - + "8s.io/apimachinery/pkg/runtime/generated" - + ".proto\0326k8s.io/apimachinery/pkg/runtime/" - + "schema/generated.proto\"\275\001\n\007CronJob\022B\n\010me" - + "tadata\030\001 \001(\01320.k8s.io.apimachinery.pkg.a" - + "pis.meta.v1.ObjectMeta\0224\n\004spec\030\002 \001(\0132&.k" - + "8s.io.api.batch.v2alpha1.CronJobSpec\0228\n\006" - + "status\030\003 \001(\0132(.k8s.io.api.batch.v2alpha1" - + ".CronJobStatus\"\202\001\n\013CronJobList\022@\n\010metada" - + "ta\030\001 \001(\0132..k8s.io.apimachinery.pkg.apis." - + "meta.v1.ListMeta\0221\n\005items\030\002 \003(\0132\".k8s.io" - + ".api.batch.v2alpha1.CronJob\"\361\001\n\013CronJobS" - + "pec\022\020\n\010schedule\030\001 \001(\t\022\037\n\027startingDeadlin" - + "eSeconds\030\002 \001(\003\022\031\n\021concurrencyPolicy\030\003 \001(" - + "\t\022\017\n\007suspend\030\004 \001(\010\022?\n\013jobTemplate\030\005 \001(\0132" - + "*.k8s.io.api.batch.v2alpha1.JobTemplateS" - + "pec\022\"\n\032successfulJobsHistoryLimit\030\006 \001(\005\022" - + "\036\n\026failedJobsHistoryLimit\030\007 \001(\005\"\212\001\n\rCron" - + "JobStatus\0223\n\006active\030\001 \003(\0132#.k8s.io.api.c" - + "ore.v1.ObjectReference\022D\n\020lastScheduleTi" - + "me\030\004 \001(\0132*.k8s.io.apimachinery.pkg.apis." - + "meta.v1.Time\"\217\001\n\013JobTemplate\022B\n\010metadata" - + "\030\001 \001(\01320.k8s.io.apimachinery.pkg.apis.me" - + "ta.v1.ObjectMeta\022<\n\010template\030\002 \001(\0132*.k8s" - + ".io.api.batch.v2alpha1.JobTemplateSpec\"\201" - + "\001\n\017JobTemplateSpec\022B\n\010metadata\030\001 \001(\01320.k" - + "8s.io.apimachinery.pkg.apis.meta.v1.Obje" - + "ctMeta\022*\n\004spec\030\002 \001(\0132\034.k8s.io.api.batch." - + "v1.JobSpecB5\n\032io.kubernetes.client.proto" - + "B\rV2alpha1BatchZ\010v2alpha1" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.kubernetes.client.proto.V1Batch.getDescriptor(), - io.kubernetes.client.proto.V1.getDescriptor(), - io.kubernetes.client.proto.Meta.getDescriptor(), - io.kubernetes.client.proto.Runtime.getDescriptor(), - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(), - }, - assigner); - internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_k8s_io_api_batch_v2alpha1_CronJob_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_CronJob_descriptor, - new java.lang.String[] { - "Metadata", "Spec", "Status", - }); - internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_k8s_io_api_batch_v2alpha1_CronJobList_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_CronJobList_descriptor, - new java.lang.String[] { - "Metadata", "Items", - }); - internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_CronJobSpec_descriptor, - new java.lang.String[] { - "Schedule", - "StartingDeadlineSeconds", - "ConcurrencyPolicy", - "Suspend", - "JobTemplate", - "SuccessfulJobsHistoryLimit", - "FailedJobsHistoryLimit", - }); - internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_CronJobStatus_descriptor, - new java.lang.String[] { - "Active", "LastScheduleTime", - }); - internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_JobTemplate_descriptor, - new java.lang.String[] { - "Metadata", "Template", - }); - internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_k8s_io_api_batch_v2alpha1_JobTemplateSpec_descriptor, - new java.lang.String[] { - "Metadata", "Spec", - }); - io.kubernetes.client.proto.V1Batch.getDescriptor(); - io.kubernetes.client.proto.V1.getDescriptor(); - io.kubernetes.client.proto.Meta.getDescriptor(); - io.kubernetes.client.proto.Runtime.getDescriptor(); - io.kubernetes.client.proto.RuntimeSchema.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java b/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java deleted file mode 100644 index bfedca2687..0000000000 --- a/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.util.authenticators; - -import com.microsoft.aad.adal4j.AuthenticationContext; -import com.microsoft.aad.adal4j.AuthenticationResult; -import io.kubernetes.client.util.KubeConfig; -import java.net.MalformedURLException; -import java.util.Date; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -/** - * The Authenticator interface represents a plugin that can handle a specific type of authentication - * information (e.g. 'azure') - */ -public class AzureActiveDirectoryAuthenticator implements Authenticator { - static { - KubeConfig.registerAuthenticator(new AzureActiveDirectoryAuthenticator()); - } - - private static final String ACCESS_TOKEN = "access-token"; - private static final String EXPIRES_ON = "expires-on"; - private static final String TENANT_ID = "tenant-id"; - private static final String CLIENT_ID = "client-id"; - private static final String REFRESH_TOKEN = "refresh-token"; - - @Override - public String getName() { - return "azure"; - } - - @Override - public String getToken(Map config) { - return (String) config.get(ACCESS_TOKEN); - } - - @Override - public boolean isExpired(Map config) { - String expiresOn = (String) config.get(EXPIRES_ON); - if (expiresOn == null || expiresOn.length() == 0) { - return true; - } - Date expiry = new Date(Long.parseLong(expiresOn) * 1000); - return expiry.compareTo(new Date()) <= 0; - } - - @Override - public Map refresh(Map config) { - // TODO: Support national clouds! - String cloud = "https://login.microsoftonline.com"; - String tenantId = (String) config.get(TENANT_ID); - String authority = cloud + "/" + tenantId; - String clientId = (String) config.get(CLIENT_ID); - String refreshToken = (String) config.get(REFRESH_TOKEN); - - try { - AuthenticationContext context = - new AuthenticationContext(authority, true, Executors.newSingleThreadExecutor()); - Future resultFuture = - context.acquireTokenByRefreshToken(refreshToken, clientId, null); - AuthenticationResult result = resultFuture.get(); - config.put(ACCESS_TOKEN, result.getAccessToken()); - config.put(REFRESH_TOKEN, result.getRefreshToken()); - - return config; - - } catch (InterruptedException | MalformedURLException | ExecutionException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java b/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java deleted file mode 100644 index 884422de18..0000000000 --- a/util/src/main/java/io/kubernetes/client/util/eks/AWS4STSSigner.java +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.util.eks; - -import org.apache.http.client.utils.URIBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Date; -import java.util.Map; - - -/** - * Sample AWS4 signer demonstrating how to sign requests to Amazon S3 using - * query string parameters. - */ -public class AWS4STSSigner extends AWS4SignerBase { - - private static final Logger log = LoggerFactory.getLogger(AWS4STSSigner.class); - - public AWS4STSSigner(URL endpointUrl, String httpMethod, - String serviceName, String regionName) { - super(endpointUrl, httpMethod, serviceName, regionName); - } - - /** - * Computes an AWS4 authorization for a request, suitable for embedding in - * query parameters. - * - * @param headers - * The request headers; 'Host' and 'X-Amz-Date' will be added to - * this set. - * @param queryParameters - * Any query parameters that will be added to the endpoint. The - * parameters should be specified in canonical format. - * @param bodyHash - * Precomputed SHA256 hash of the request body content; this - * value should also be set as the header 'X-Amz-Content-SHA256' - * for non-streaming uploads. - * @param awsAccessKey - * The user's AWS Access Key. - * @param awsSecretKey - * The user's AWS Secret Key. - * @return The computed authorization string for the request. This value - * needs to be set as the header 'Authorization' on the subsequent - * HTTP request. - */ - public String computeSignature(URI endpoint, - Map headers, - Map queryParameters, - int expiringInSeconds, - String bodyHash, - String awsAccessKey, - String awsSecretKey, - String sessionToken) throws URISyntaxException { - // first get the date and time for the subsequent request, and convert - // to ISO 8601 format - // for use in signature generation - Date now = new Date(); - String dateTimeStamp = dateTimeFormat.format(now); - - // make sure "Host" header is added - String hostHeader = endpointUrl.getHost(); - int port = endpointUrl.getPort(); - if ( port > -1 ) { - hostHeader.concat(":" + Integer.toString(port)); - } - headers.put("Host", hostHeader); - - // canonicalized headers need to be expressed in the query - // parameters processed in the signature - String canonicalizedHeaderNames = getCanonicalizeHeaderNames(headers); - String canonicalizedHeaders = getCanonicalizedHeaderString(headers); - - // we need scope as part of the query parameters - String dateStamp = dateStampFormat.format(now); - String scope = dateStamp + "/" + regionName + "/" + serviceName + "/" + TERMINATOR; - - // add the fixed authorization params required by Signature V4 - queryParameters.put("X-Amz-Algorithm", SCHEME + "-" + ALGORITHM); - queryParameters.put("X-Amz-Credential", awsAccessKey + "/" + scope); - - // x-amz-date is now added as a query parameter, but still need to be in ISO8601 basic form - queryParameters.put("X-Amz-Date", dateTimeStamp); - queryParameters.put("X-Amz-Expires", String.valueOf(expiringInSeconds)); - - queryParameters.put("X-Amz-Security-Token", sessionToken); - - queryParameters.put("X-Amz-SignedHeaders", canonicalizedHeaderNames); - - // build the expanded canonical query parameter string that will go into the - // signature computation - String canonicalizedQueryParameters = getCanonicalizedQueryString(queryParameters); - - // express all the header and query parameter data as a canonical request string - String canonicalRequest = getCanonicalRequest(endpointUrl, httpMethod, - canonicalizedQueryParameters, canonicalizedHeaderNames, - canonicalizedHeaders, bodyHash); - log.debug("--------- Canonical request --------"); - log.debug(canonicalRequest); - log.debug("------------------------------------"); - - // construct the string to be signed - String stringToSign = getStringToSign(SCHEME, ALGORITHM, dateTimeStamp, scope, canonicalRequest); - log.debug("--------- String to sign -----------"); - log.debug(stringToSign); - log.debug("------------------------------------"); - - // compute the signing key - byte[] kSecret = (SCHEME + awsSecretKey).getBytes(); - byte[] kDate = sign(dateStamp, kSecret, "HmacSHA256"); - byte[] kRegion = sign(regionName, kDate, "HmacSHA256"); - byte[] kService = sign(serviceName, kRegion, "HmacSHA256"); - byte[] kSigning = sign(TERMINATOR, kService, "HmacSHA256"); - byte[] signature = sign(stringToSign, kSigning, "HmacSHA256"); - - // form up the authorization parameters for the caller to place in the query string - StringBuilder authString = new StringBuilder(); - URIBuilder builder = new URIBuilder(endpoint); - queryParameters.forEach((k, v)-> { - builder.addParameter(k, v); - }); - builder.addParameter("X-Amz-Signature", BinaryUtils.toHex(signature)); - authString.append(builder.build()); - return authString.toString(); - } - -} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java b/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java deleted file mode 100644 index 131a24c63f..0000000000 --- a/util/src/main/java/io/kubernetes/client/util/eks/AWS4SignerBase.java +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.util.eks; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import java.net.URL; -import java.security.MessageDigest; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.SimpleTimeZone; -import java.util.SortedMap; -import java.util.TreeMap; - - -/** - * Common methods and properties for all AWS4 signer variants - */ -public abstract class AWS4SignerBase { - - /** SHA256 hash of an empty request body **/ - public static final String EMPTY_BODY_SHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - public static final String UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; - - public static final String SCHEME = "AWS4"; - public static final String ALGORITHM = "HMAC-SHA256"; - public static final String TERMINATOR = "aws4_request"; - - /** format strings for the date/time and date stamps required during signing **/ - public static final String ISO8601BasicFormat = "yyyyMMdd'T'HHmmss'Z'"; - public static final String DateStringFormat = "yyyyMMdd"; - - protected URL endpointUrl; - protected String httpMethod; - protected String serviceName; - protected String regionName; - - protected final SimpleDateFormat dateTimeFormat; - protected final SimpleDateFormat dateStampFormat; - - /** - * Create a new AWS V4 signer. - * - * @param endpointUrl - * The service endpoint, including the path to any resource. - * @param httpMethod - * The HTTP verb for the request, e.g. GET. - * @param serviceName - * The signing name of the service, e.g. 's3'. - * @param regionName - * The system name of the AWS region associated with the - * endpoint, e.g. us-east-1. - */ - public AWS4SignerBase(URL endpointUrl, String httpMethod, - String serviceName, String regionName) { - this.endpointUrl = endpointUrl; - this.httpMethod = httpMethod; - this.serviceName = serviceName; - this.regionName = regionName; - - dateTimeFormat = new SimpleDateFormat(ISO8601BasicFormat); - dateTimeFormat.setTimeZone(new SimpleTimeZone(0, "UTC")); - dateStampFormat = new SimpleDateFormat(DateStringFormat); - dateStampFormat.setTimeZone(new SimpleTimeZone(0, "UTC")); - } - - /** - * Returns the canonical collection of header names that will be included in - * the signature. For AWS4, all header names must be included in the process - * in sorted canonicalized order. - */ - protected static String getCanonicalizeHeaderNames(Map headers) { - List sortedHeaders = new ArrayList(); - sortedHeaders.addAll(headers.keySet()); - Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); - - StringBuilder buffer = new StringBuilder(); - for (String header : sortedHeaders) { - if (buffer.length() > 0) buffer.append(";"); - buffer.append(header.toLowerCase()); - } - - return buffer.toString(); - } - - /** - * Computes the canonical headers with values for the request. For AWS4, all - * headers must be included in the signing process. - */ - protected static String getCanonicalizedHeaderString(Map headers) { - if ( headers == null || headers.isEmpty() ) { - return ""; - } - - // step1: sort the headers by case-insensitive order - List sortedHeaders = new ArrayList(); - sortedHeaders.addAll(headers.keySet()); - Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); - - // step2: form the canonical header:value entries in sorted order. - // Multiple white spaces in the values should be compressed to a single - // space. - StringBuilder buffer = new StringBuilder(); - for (String key : sortedHeaders) { - buffer.append(key.toLowerCase().replaceAll("\\s+", " ") + ":" + headers.get(key).replaceAll("\\s+", " ")); - buffer.append("\n"); - } - - return buffer.toString(); - } - - /** - * Returns the canonical request string to go into the signer process; this - consists of several canonical sub-parts. - * @return - */ - protected static String getCanonicalRequest(URL endpoint, - String httpMethod, - String queryParameters, - String canonicalizedHeaderNames, - String canonicalizedHeaders, - String bodyHash) { - String canonicalRequest = - httpMethod + "\n" + - getCanonicalizedResourcePath(endpoint) + "\n" + - queryParameters + "\n" + - canonicalizedHeaders + "\n" + - canonicalizedHeaderNames + "\n" + - bodyHash; - return canonicalRequest; - } - - /** - * Returns the canonicalized resource path for the service endpoint. - */ - protected static String getCanonicalizedResourcePath(URL endpoint) { - if ( endpoint == null ) { - return "/"; - } - String path = endpoint.getPath(); - if ( path == null || path.isEmpty() ) { - return "/"; - } - - String encodedPath = HttpUtils.urlEncode(path, true); - if (encodedPath.startsWith("/")) { - return encodedPath; - } else { - return "/".concat(encodedPath); - } - } - - /** - * Examines the specified query string parameters and returns a - * canonicalized form. - *

- * The canonicalized query string is formed by first sorting all the query - * string parameters, then URI encoding both the key and value and then - * joining them, in order, separating key value pairs with an '&'. - * - * @param parameters - * The query string parameters to be canonicalized. - * - * @return A canonicalized form for the specified query string parameters. - */ - public static String getCanonicalizedQueryString(Map parameters) { - if ( parameters == null || parameters.isEmpty() ) { - return ""; - } - - SortedMap sorted = new TreeMap(); - - Iterator> pairs = parameters.entrySet().iterator(); - while (pairs.hasNext()) { - Map.Entry pair = pairs.next(); - String key = pair.getKey(); - String value = pair.getValue(); - sorted.put(HttpUtils.urlEncode(key, false), HttpUtils.urlEncode(value, false)); - } - - StringBuilder builder = new StringBuilder(); - pairs = sorted.entrySet().iterator(); - while (pairs.hasNext()) { - Map.Entry pair = pairs.next(); - builder.append(pair.getKey()); - builder.append("="); - builder.append(pair.getValue()); - if (pairs.hasNext()) { - builder.append("&"); - } - } - - return builder.toString(); - } - - protected static String getStringToSign(String scheme, String algorithm, String dateTime, String scope, String canonicalRequest) { - String stringToSign = - scheme + "-" + algorithm + "\n" + - dateTime + "\n" + - scope + "\n" + - BinaryUtils.toHex(hash(canonicalRequest)); - return stringToSign; - } - - /** - * Hashes the string contents (assumed to be UTF-8) using the SHA-256 - * algorithm. - */ - public static byte[] hash(String text) { - try { - MessageDigest md = MessageDigest.getInstance("SHA-256"); - md.update(text.getBytes("UTF-8")); - return md.digest(); - } catch (Exception e) { - throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(), e); - } - } - - /** - * Hashes the byte array using the SHA-256 algorithm. - */ - public static byte[] hash(byte[] data) { - try { - MessageDigest md = MessageDigest.getInstance("SHA-256"); - md.update(data); - return md.digest(); - } catch (Exception e) { - throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(), e); - } - } - - protected static byte[] sign(String stringData, byte[] key, String algorithm) { - try { - byte[] data = stringData.getBytes("UTF-8"); - Mac mac = Mac.getInstance(algorithm); - mac.init(new SecretKeySpec(key, algorithm)); - return mac.doFinal(data); - } catch (Exception e) { - throw new RuntimeException("Unable to calculate a request signature: " + e.getMessage(), e); - } - } -} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java b/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java deleted file mode 100644 index 039ef20ad8..0000000000 --- a/util/src/main/java/io/kubernetes/client/util/eks/BinaryUtils.java +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.util.eks; - -import java.util.Locale; - -/** - * Utilities for encoding and decoding binary data to and from different forms. - */ -public class BinaryUtils { - - /** - * Converts byte data to a Hex-encoded string. - * - * @param data - * data to hex encode. - * - * @return hex-encoded string. - */ - public static String toHex(byte[] data) { - StringBuilder sb = new StringBuilder(data.length * 2); - for (int i = 0; i < data.length; i++) { - String hex = Integer.toHexString(data[i]); - if (hex.length() == 1) { - // Append leading zero. - sb.append("0"); - } else if (hex.length() == 8) { - // Remove ff prefix from negative numbers. - hex = hex.substring(6); - } - sb.append(hex); - } - return sb.toString().toLowerCase(Locale.getDefault()); - } - - /** - * Converts a Hex-encoded data string to the original byte data. - * - * @param hexData - * hex-encoded data to decode. - * @return decoded data from the hex string. - */ - public static byte[] fromHex(String hexData) { - byte[] result = new byte[(hexData.length() + 1) / 2]; - String hexNumber = null; - int stringOffset = 0; - int byteOffset = 0; - while (stringOffset < hexData.length()) { - hexNumber = hexData.substring(stringOffset, stringOffset + 2); - stringOffset += 2; - result[byteOffset++] = (byte) Integer.parseInt(hexNumber, 16); - } - return result; - } -} diff --git a/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java b/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java deleted file mode 100644 index 470564b9f0..0000000000 --- a/util/src/main/java/io/kubernetes/client/util/eks/HttpUtils.java +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package io.kubernetes.client.util.eks; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.util.Map; - -/** - * Various Http helper routines - */ -public class HttpUtils { - - private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); - /** - * Makes a http request to the specified endpoint - */ - public static String invokeHttpRequest(URL endpointUrl, - String httpMethod, - Map headers, - String requestBody) { - HttpURLConnection connection = createHttpConnection(endpointUrl, httpMethod, headers); - try { - if ( requestBody != null ) { - DataOutputStream wr = new DataOutputStream( - connection.getOutputStream()); - wr.writeBytes(requestBody); - wr.flush(); - wr.close(); - } - } catch (Exception e) { - throw new RuntimeException("Request failed. " + e.getMessage(), e); - } - return executeHttpRequest(connection); - } - - public static String executeHttpRequest(HttpURLConnection connection) { - try { - // Get Response - InputStream is; - try { - is = connection.getInputStream(); - } catch (IOException e) { - is = connection.getErrorStream(); - } - - BufferedReader rd = new BufferedReader(new InputStreamReader(is)); - String line; - StringBuffer response = new StringBuffer(); - while ((line = rd.readLine()) != null) { - response.append(line); - response.append('\r'); - } - rd.close(); - return response.toString(); - } catch (Exception e) { - throw new RuntimeException("Request failed. " + e.getMessage(), e); - } finally { - if (connection != null) { - connection.disconnect(); - } - } - } - - public static HttpURLConnection createHttpConnection(URL endpointUrl, - String httpMethod, - Map headers) { - try { - HttpURLConnection connection = (HttpURLConnection) endpointUrl.openConnection(); - connection.setRequestMethod(httpMethod); - - if ( headers != null ) { - log.debug("--------- Request headers ---------"); - for ( String headerKey : headers.keySet() ) { - log.debug(headerKey + ": " + headers.get(headerKey)); - connection.setRequestProperty(headerKey, headers.get(headerKey)); - } - } - - connection.setUseCaches(false); - connection.setDoInput(true); - connection.setDoOutput(true); - return connection; - } catch (Exception e) { - throw new RuntimeException("Cannot create connection. " + e.getMessage(), e); - } - } - - public static String urlEncode(String url, boolean keepPathSlash) { - String encoded; - try { - encoded = URLEncoder.encode(url, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 encoding is not supported.", e); - } - if ( keepPathSlash ) { - encoded = encoded.replace("%2F", "/"); - } - return encoded; - } -}