Compare commits

..

10 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
212f6de9ba Merge pull request #107 from codedownio/master
Some checks failed
CI / Cabal / K8S 1.25 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.26 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.27 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.28 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.29 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.30 / GHC 9.6.5 (push) Has been cancelled
CI / Cabal / K8S 1.25 / GHC 9.8.2 (push) Has been cancelled
CI / Cabal / K8S 1.26 / GHC 9.8.2 (push) Has been cancelled
CI / Cabal / K8S 1.27 / GHC 9.8.2 (push) Has been cancelled
CI / Cabal / K8S 1.28 / GHC 9.8.2 (push) Has been cancelled
CI / Cabal / K8S 1.29 / GHC 9.8.2 (push) Has been cancelled
CI / Cabal / K8S 1.30 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.25 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.26 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.27 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.28 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.29 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.30 / GHC 9.4.8 (push) Has been cancelled
CI / Stack / K8S 1.25 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.26 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.27 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.28 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.29 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.30 / GHC 9.6.5 (push) Has been cancelled
CI / Stack / K8S 1.25 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.26 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.27 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.28 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.29 / GHC 9.8.2 (push) Has been cancelled
CI / Stack / K8S 1.30 / GHC 9.8.2 (push) Has been cancelled
Support all Kubernetes versions 1.20 through 1.30
2024-09-07 21:27:19 +01:00
thomasjm
a747f6fdc6 Remove openapi.yaml from extra-source-files 2024-07-23 03:44:46 -07:00
Tom McLaughlin
47d88d7061 Fix a bunch of warnings 2024-06-19 19:51:17 -07:00
thomasjm
2b0ba85e61 Build and test all K8S versions 1.20-1.30, GHC up to 9.8 2024-06-19 19:51:08 -07:00
thomasjm
bb72266e67 Bump more bounds to build on GHC 9.8.2 2024-06-12 11:40:04 -07:00
Tom McLaughlin
82f233c98f Switch from connection -> crypton-connection and build with GHC 9.6.3 2024-02-21 19:21:52 -08:00
Kubernetes Prow Robot
56bed0844d Merge pull request #104 from codedownio/modernize
Fix build for GHC 9.4 and enable GitHub Actions CI
2023-07-04 12:58:54 -07:00
Tom McLaughlin
8990d265dc Try bumping connection bound to >=0.3 2023-06-26 19:06:10 -07:00
Tom McLaughlin
b59287f500 Tweak ci.yml 2023-06-26 19:06:10 -07:00
Tom McLaughlin
3e695764cd Switch to using explicit stack.yaml files in CI 2023-06-26 19:06:10 -07:00
1016 changed files with 920248 additions and 457903 deletions

View File

@@ -2,59 +2,109 @@ on: [push]
name: CI name: CI
jobs: jobs:
cabal: cabal:
name: Cabal / GHC ${{ matrix.ghc }} name: Cabal / K8S ${{ matrix.k8s_release }} / GHC ${{ matrix.ghc }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
# This full matrix at time of writing is 11 K8S versions * 6 compiler versions = 66,
# which is a little big for CI.
# Commented some older versions of each to make it manageable.
matrix: matrix:
k8s_release:
# - "1.20"
# - "1.21"
# - "1.22"
# - "1.23"
# - "1.24"
- "1.25"
- "1.26"
- "1.27"
- "1.28"
- "1.29"
- "1.30"
ghc: ghc:
- "8.10.7" # - "8.10.7"
- "9.0.2" # - "9.0.2"
- "9.2.8" # - "9.2.8"
- "9.4.5" - "9.4.8"
- "9.6.5"
- "9.8.2"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
with: with:
ghc-version: ${{ matrix.ghc }} ghc-version: ${{ matrix.compiler.ghc }}
cabal-version: '3.8.1.0' cabal-version: '3.10.3.0'
- run: cabal build all --enable-tests
- run: cabal test all - uses: cachix/install-nix-action@v27
- run: |
nix run .#set-cabal-version -- "${{matrix.k8s_release}}" cabal.project
cabal build all --enable-tests
- run: |
cabal test all
stack: stack:
name: Stack / GHC ${{ matrix.ghc }} name: Stack / K8S ${{ matrix.k8s_release }} / GHC ${{ matrix.compiler.ghc }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
# This full matrix at time of writing is 11 K8S versions * 7 compiler versions = 77,
# which is a little big for CI.
# Commented some older versions of each to make it manageable.
matrix: matrix:
include: k8s_release:
- ghc: "8.10.7" # - "1.20"
resolver: "lts-18.28" # - "1.21"
- ghc: "9.0.2" # - "1.22"
resolver: "lts-19.33" # - "1.23"
- ghc: "9.2.8" # - "1.24"
resolver: "lts-20.26" - "1.25"
- ghc: "9.4.5" - "1.26"
resolver: "lts-21.0" - "1.27"
- "1.28"
- "1.29"
- "1.30"
compiler:
# - ghc: "8.10.7"
# yaml: "stack-8.10.7.yaml"
# - ghc: "9.0.2"
# yaml: "stack-9.0.2-aeson1.yaml"
# - ghc: "9.0.2"
# yaml: "stack-9.0.2-aeson2.yaml"
# - ghc: "9.2.8"
# yaml: "stack-9.2.8.yaml"
- ghc: "9.4.8"
yaml: "stack-9.4.8.yaml"
- ghc: "9.6.5"
yaml: "stack-9.6.5.yaml"
- ghc: "9.8.2"
yaml: "stack.yaml"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: haskell/actions/setup@v2 - uses: haskell-actions/setup@v2
with: with:
ghc-version: ${{ matrix.ghc }} ghc-version: ${{ matrix.compiler.ghc }}
enable-stack: true enable-stack: true
stack-version: "latest" stack-version: "latest"
- uses: actions/cache@v3 - uses: cachix/install-nix-action@v27
- uses: actions/cache@v4
name: Cache ~/.stack name: Cache ~/.stack
with: with:
path: ~/.stack path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.resolver }}-stack2 key: ${{ runner.os }}-${{ matrix.compiler.ghc }}-${{ matrix.compiler.yaml }}
- name: Build - name: Build
run: | run: |
stack build --resolver ${{matrix.resolver}} --system-ghc --test --bench --no-run-tests --no-run-benchmarks nix run .#set-stack-version -- "${{matrix.k8s_release}}" "${{matrix.compiler.yaml}}"
stack build --stack-yaml ${{matrix.compiler.yaml}} --system-ghc --test --bench --no-run-tests --no-run-benchmarks
- name: Test - name: Test
run: | run: |
stack test --resolver ${{matrix.resolver}} --system-ghc stack test --stack-yaml ${{matrix.compiler.yaml}} --system-ghc

4
.gitignore vendored
View File

@@ -18,3 +18,7 @@ cabal.sandbox.config
.stack-work/ .stack-work/
cabal.project.local cabal.project.local
.HTF/ .HTF/
swagger.json
swagger.json.unprocessed
git_push.sh
openapi.yaml

19
build_all.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPTDIR"
# This script builds kubernetes-client + kubernetes-client-core for
# all Kubernetes versions.
nix run .#set-stack-version 1.20 stack.yaml && stack build
nix run .#set-stack-version 1.21 stack.yaml && stack build
nix run .#set-stack-version 1.22 stack.yaml && stack build
nix run .#set-stack-version 1.23 stack.yaml && stack build
nix run .#set-stack-version 1.24 stack.yaml && stack build
nix run .#set-stack-version 1.25 stack.yaml && stack build
nix run .#set-stack-version 1.26 stack.yaml && stack build
nix run .#set-stack-version 1.27 stack.yaml && stack build
nix run .#set-stack-version 1.28 stack.yaml && stack build
nix run .#set-stack-version 1.29 stack.yaml && stack build
nix run .#set-stack-version 1.30 stack.yaml && stack build

View File

@@ -1,4 +1,9 @@
packages: packages:
kubernetes kubernetes-1.21
kubernetes-client kubernetes-client
examples examples
source-repository-package
type: git
location: https://github.com/codedownio/haskell-oidc-client
tag: b70757b85751525cba41316ea9af132d9a43cfaf

99
flake.lock generated Normal file
View File

@@ -0,0 +1,99 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gen": {
"flake": false,
"locked": {
"lastModified": 1716569711,
"narHash": "sha256-SKEbJlkskwVZcA+OUAnjPjHwfADV8TXxfxzu+8kpFBw=",
"owner": "kubernetes-client",
"repo": "gen",
"rev": "2658f902d35aed7fcf1823b442eb87b44d812ac1",
"type": "github"
},
"original": {
"owner": "kubernetes-client",
"repo": "gen",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1718321993,
"narHash": "sha256-dayaR6a+NrClBd1rXKcTU9/g6qo2Ms+PcvAIN4bcb6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1db848eeaefe7afa0d2c7192e8aba962ec34d3f0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"gen": "gen",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

53
flake.nix Normal file
View File

@@ -0,0 +1,53 @@
{
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gen = {
url = "github:kubernetes-client/gen";
flake = false;
};
inputs.gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=release-24.05";
outputs = { self, flake-utils, gen, gitignore, nixpkgs }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
let
pkgs = import nixpkgs { inherit system; };
in {
packages = rec {
generate = pkgs.writeShellScriptBin "generate-kubernetes-client-core.sh" ''
export KUBERNETES_VERSION="$1"
PACKAGE_VERSION="$2"
out="kubernetes-$KUBERNETES_VERSION"
# Generate
${pkgs.bash}/bin/bash "${gen}/openapi/haskell.sh" "$out" settings
# Fill in the package version
${pkgs.gnused}/bin/sed -i "s/^version:\s*\(.*\)/version: $PACKAGE_VERSION/" "$out/kubernetes-client-core.cabal"
# Fix a bound
${pkgs.gnused}/bin/sed -i 's/\(http-api-data >= 0.3.4 &&\) <0.6/\1 <0.7/' "$out/kubernetes-client-core.cabal"
# Delete openapi.yaml from the extra-source-files
${pkgs.gnused}/bin/sed -i '/^\s*openapi\.yaml$/d' "$out/kubernetes-client-core.cabal"
'';
set-stack-version = pkgs.writeShellScriptBin "build-kubernetes-client.sh" ''
export KUBERNETES_VERSION="$1"
STACK_YAML="$2"
${pkgs.gnused}/bin/sed -i "s/^- kubernetes-\(1\.\)[0-9]\+/- kubernetes-$KUBERNETES_VERSION/" "$STACK_YAML"
'';
set-cabal-version = pkgs.writeShellScriptBin "build-kubernetes-client.sh" ''
export KUBERNETES_VERSION="$1"
CABAL_PROJECT="$2"
${pkgs.gnused}/bin/sed -i "s/^ kubernetes-\(1\.\)[0-9]\+/ kubernetes-$KUBERNETES_VERSION/" "$CABAL_PROJECT"
'';
};
});
}

21
generate_all.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPTDIR"
# The first argument is the Kubernetes release to use.
# The second is the package version to place in ./kubernetes-<K8S version>/kubernetes-client-core.cabal.
# The idea is to use the patch number for our own purposes, incrementing when we need to update
# the kubernetes-client-core library.
nix run .#generate -- 1.20 1.20.0
nix run .#generate -- 1.21 1.21.0
nix run .#generate -- 1.22 1.22.0
nix run .#generate -- 1.23 1.23.0
nix run .#generate -- 1.24 1.24.0
nix run .#generate -- 1.25 1.25.0
nix run .#generate -- 1.26 1.26.0
nix run .#generate -- 1.27 1.27.0
nix run .#generate -- 1.28 1.28.0
nix run .#generate -- 1.29 1.29.0
nix run .#generate -- 1.30 1.30.0

View File

@@ -21,5 +21,3 @@
#docs/*.md #docs/*.md
# Then explicitly reverse the ignore rule for a single file: # Then explicitly reverse the ignore rule for a single file:
#!docs/README.md #!docs/README.md
README.md

View File

@@ -0,0 +1,2 @@
Requested Commit/Tag : ab7d0cb74f6ef95bdaeafd327bbdb5d54f819175
Actual Commit : ab7d0cb74f6ef95bdaeafd327bbdb5d54f819175

View File

@@ -1,5 +1,6 @@
.gitignore .gitignore
.travis.yml .travis.yml
README.md
Setup.hs Setup.hs
git_push.sh git_push.sh
kubernetes-client-core.cabal kubernetes-client-core.cabal

View File

@@ -0,0 +1 @@
7.6.0

View File

@@ -0,0 +1 @@
19f91fe5110cab07889fb5816d54a140ac5072c7e6e791580eaca741a56bd203

203
kubernetes-1.20/README.md Normal file
View File

@@ -0,0 +1,203 @@
## OpenAPI Auto-Generated [http-client](https://www.stackage.org/lts-10.0/package/http-client-0.5.7.1) Bindings to `Kubernetes`
The library in `lib` provides auto-generated-from-OpenAPI [http-client](https://www.stackage.org/lts-10.0/package/http-client-0.5.7.1) bindings to the Kubernetes API.
OpenApi Version: 3.0.1
## Installation
Installation follows the standard approach to installing Stack-based projects.
1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README).
2. To build the package, and generate the documentation (recommended):
```
stack haddock
```
which will generate docs for this lib in the `docs` folder.
To generate the docs in the normal location (to enable hyperlinks to external libs), remove
```
build:
haddock-arguments:
haddock-args:
- "--odir=./docs"
```
from the stack.yaml file and run `stack haddock` again.
3. To run unit tests:
```
stack test
```
## OpenAPI-Generator
The code generator that produced this library, and which explains how
to obtain and use the openapi-generator cli tool lives at
https://openapi-generator.tech
The _generator-name_ argument (`--generator-name`) passed to the cli tool used should be
```
haskell-http-client
```
### Unsupported OpenAPI Features
* Model Inheritance
This is beta software; other cases may not be supported.
### Codegen "additional properties" parameters
These options allow some customization of the code generation process.
**haskell-http-client additional properties:**
| OPTION | DESCRIPTION | DEFAULT | ACTUAL |
|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------------------|
| allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | true |
| allowNonUniqueOperationIds | allow *different* API modules to contain the same operationId. Each API must be imported qualified | false | true |
| allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | false |
| baseModule | Set the base module namespace | | Kubernetes.OpenAPI |
| cabalPackage | Set the cabal package name, which consists of one or more alphanumeric words separated by hyphens | | kubernetes-client-core |
| cabalVersion | Set the cabal version number, consisting of a sequence of one or more integers separated by dots | 0.1.0.0 | 0.1.0.0 |
| customTestInstanceModule | test module used to provide typeclass instances for types not known by the generator | | CustomInstances |
| configType | Set the name of the type used for configuration | | KubernetesClientConfig |
| dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d |
| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | %FT%T%6QZ |
| dateTimeParseFormat | overrides the format string used to parse a datetime | | %FT%T%QZ |
| generateEnums | Generate specific datatypes for OpenAPI enums | true | true |
| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true |
| generateLenses | Generate Lens optics for Models | true | true |
| generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true |
| inlineMimeTypes | Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option | true | true |
| modelDeriving | Additional classes to include in the deriving() clause of Models | | |
| requestType | Set the name of the type used to generate requests | | KubernetesRequest |
| strictFields | Add strictness annotations to all model fields | true | true |
| useKatip | Sets the default value for the UseKatip cabal flag. If true, the katip package provides logging instead of monad-logger | true | true |
| queryExtraUnreserved | Configures additional querystring characters which must not be URI encoded, e.g. '+' or ':' | | + |
[1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis
An example setting _dateTimeFormat_ and _strictFields_:
```
java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false
```
View the full list of Codegen "config option" parameters with the command:
```
java -jar openapi-generator-cli.jar config-help -g haskell-http-client
```
## Usage Notes
### Example Petstore Haddock documentation
An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (Petstore) can be found [here][2]
[2]: https://hackage.haskell.org/package/swagger-petstore
### Example Petstore App
An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3]
[3]: https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/haskell-http-client/example-app
This library is intended to be imported qualified.
### Modules
| MODULE | NOTES |
| ------------------- | --------------------------------------------------- |
| Kubernetes.OpenAPI.Client | use the "dispatch" functions to send requests |
| Kubernetes.OpenAPI.Core | core functions, config and request types |
| Kubernetes.OpenAPI.API | construct api requests |
| Kubernetes.OpenAPI.Model | describes api models |
| Kubernetes.OpenAPI.MimeTypes | encoding/decoding MIME types (content-types/accept) |
| Kubernetes.OpenAPI.ModelLens | lenses for model fields |
| Kubernetes.OpenAPI.Logging | logging functions and utils |
### MimeTypes
This library adds type safety around what OpenAPI specifies as
Produces and Consumes for each Operation (e.g. the list of MIME types an
Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers).
For example, if there is an Operation named _addFoo_, there will be a
data type generated named _AddFoo_ (note the capitalization), which
describes additional constraints and actions on the _addFoo_ operation
via its typeclass instances. These typeclass instances can be viewed
in GHCi or via the Haddocks.
* required parameters are included as function arguments to _addFoo_
* optional non-body parameters are included by using `applyOptionalParam`
* optional body parameters are set by using `setBodyParam`
Example code generated for pretend _addFoo_ operation:
```haskell
data AddFoo
instance Consumes AddFoo MimeJSON
instance Produces AddFoo MimeJSON
instance Produces AddFoo MimeXML
instance HasBodyParam AddFoo FooModel
instance HasOptionalParam AddFoo FooName
instance HasOptionalParam AddFoo FooId
```
this would indicate that:
* the _addFoo_ operation can consume JSON
* the _addFoo_ operation produces JSON or XML, depending on the argument passed to the dispatch function
* the _addFoo_ operation can set it's body param of _FooModel_ via `setBodyParam`
* the _addFoo_ operation can set 2 different optional parameters via `applyOptionalParam`
If the OpenAPI spec doesn't declare it can accept or produce a certain
MIME type for a given Operation, you should either add a Produces or
Consumes instance for the desired MIME types (assuming the server
supports it), use `dispatchLbsUnsafe` or modify the OpenAPI spec and
run the generator again.
New MIME type instances can be added via MimeType/MimeRender/MimeUnrender
Only JSON instances are generated by default, and in some case
x-www-form-urlencoded instances (FromFrom, ToForm) will also be
generated if the model fields are primitive types, and there are
Operations using x-www-form-urlencoded which use those models.
### Authentication
A haskell data type will be generated for each OpenAPI authentication type.
If for example the AuthMethod `AuthOAuthFoo` is generated for OAuth operations, then
`addAuthMethod` should be used to add the AuthMethod config.
When a request is dispatched, if a matching auth method is found in
the config, it will be applied to the request.
### Example
```haskell
mgr <- newManager defaultManagerSettings
config0 <- withStdoutLogging =<< newConfig
let config = config0
`addAuthMethod` AuthOAuthFoo "secret-key"
let addFooRequest =
addFoo
(ContentType MimeJSON)
(Accept MimeXML)
(ParamBar paramBar)
(ParamQux paramQux)
modelBaz
`applyOptionalParam` FooId 1
`applyOptionalParam` FooName "name"
`setHeader` [("qux_header","xxyy")]
addFooResult <- dispatchMime mgr config addFooRequest
```
See the example app and the haddocks for details.

View File

@@ -1,5 +1,5 @@
name: kubernetes-client-core name: kubernetes-client-core
version: 0.4.3.0 version: 1.20.0
synopsis: Auto-generated kubernetes-client-core API Client synopsis: Auto-generated kubernetes-client-core API Client
description: . description: .
Client library for calling the Kubernetes API based on http-client. Client library for calling the Kubernetes API based on http-client.
@@ -12,6 +12,8 @@ description: .
. .
OpenAPI version: 3.0.1 OpenAPI version: 3.0.1
. .
Generator version: 7.6.0
.
category: Web category: Web
homepage: https://github.com/kubernetes-client/haskell homepage: https://github.com/kubernetes-client/haskell
author: Auto Generated author: Auto Generated
@@ -23,7 +25,6 @@ cabal-version: >= 1.10
extra-source-files: extra-source-files:
README.md README.md
openapi.yaml
Flag UseKatip Flag UseKatip
Description: Use the katip package to provide logging (if false, use the default monad-logger package) Description: Use the katip package to provide logging (if false, use the default monad-logger package)
@@ -43,7 +44,7 @@ library
, containers >=0.5.0.0 && <0.8 , containers >=0.5.0.0 && <0.8
, deepseq >= 1.4 && <1.6 , deepseq >= 1.4 && <1.6
, exceptions >= 0.4 , exceptions >= 0.4
, http-api-data >= 0.3.4 && <0.6 , http-api-data >= 0.3.4 && <0.7
, http-client >=0.5 && <0.8 , http-client >=0.5 && <0.8
, http-client-tls , http-client-tls
, http-media >= 0.4 && < 0.9 , http-media >= 0.4 && < 0.9

View File

@@ -98,6 +98,11 @@ instance HasOptionalParam CreateClusterCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam CreateClusterCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes CreateClusterCustomObject mtype instance MimeType mtype => Consumes CreateClusterCustomObject mtype
@@ -147,6 +152,11 @@ instance HasOptionalParam CreateNamespacedCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam CreateNamespacedCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes CreateNamespacedCustomObject mtype instance MimeType mtype => Consumes CreateNamespacedCustomObject mtype
@@ -231,6 +241,11 @@ instance HasOptionalParam DeleteCollectionClusterCustomObject Pretty where
applyOptionalParam req (Pretty xs) = applyOptionalParam req (Pretty xs) =
req `addQuery` toQuery ("pretty", Just xs) req `addQuery` toQuery ("pretty", Just xs)
-- | /Optional Param/ "labelSelector" - A selector to restrict the list of returned objects by their labels. Defaults to everything.
instance HasOptionalParam DeleteCollectionClusterCustomObject LabelSelector where
applyOptionalParam req (LabelSelector xs) =
req `addQuery` toQuery ("labelSelector", Just xs)
-- | /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/ "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.
instance HasOptionalParam DeleteCollectionClusterCustomObject GracePeriodSeconds where instance HasOptionalParam DeleteCollectionClusterCustomObject GracePeriodSeconds where
applyOptionalParam req (GracePeriodSeconds xs) = applyOptionalParam req (GracePeriodSeconds xs) =
@@ -286,6 +301,11 @@ instance HasOptionalParam DeleteCollectionNamespacedCustomObject Pretty where
applyOptionalParam req (Pretty xs) = applyOptionalParam req (Pretty xs) =
req `addQuery` toQuery ("pretty", Just xs) req `addQuery` toQuery ("pretty", Just xs)
-- | /Optional Param/ "labelSelector" - A selector to restrict the list of returned objects by their labels. Defaults to everything.
instance HasOptionalParam DeleteCollectionNamespacedCustomObject LabelSelector where
applyOptionalParam req (LabelSelector xs) =
req `addQuery` toQuery ("labelSelector", Just xs)
-- | /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/ "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.
instance HasOptionalParam DeleteCollectionNamespacedCustomObject GracePeriodSeconds where instance HasOptionalParam DeleteCollectionNamespacedCustomObject GracePeriodSeconds where
applyOptionalParam req (GracePeriodSeconds xs) = applyOptionalParam req (GracePeriodSeconds xs) =
@@ -364,6 +384,27 @@ instance MimeType mtype => Consumes DeleteNamespacedCustomObject mtype
instance Produces DeleteNamespacedCustomObject MimeJSON instance Produces DeleteNamespacedCustomObject MimeJSON
-- *** getAPIResources
-- | @GET \/apis\/{group}\/{version}@
--
-- get available resources
--
-- AuthMethod: 'AuthApiKeyBearerToken'
--
getAPIResources
:: Group -- ^ "group" - The custom resource's group name
-> Version -- ^ "version" - The custom resource's version
-> KubernetesRequest GetAPIResources MimeNoContent V1APIResourceList MimeJSON
getAPIResources (Group group) (Version version) =
_mkRequest "GET" ["/apis/",toPath group,"/",toPath version]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
data GetAPIResources
-- | @application/json@
instance Produces GetAPIResources MimeJSON
-- *** getClusterCustomObject -- *** getClusterCustomObject
-- | @GET \/apis\/{group}\/{version}\/{plural}\/{name}@ -- | @GET \/apis\/{group}\/{version}\/{plural}\/{name}@
@@ -713,6 +754,11 @@ instance HasOptionalParam PatchClusterCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchClusterCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchClusterCustomObject Force where instance HasOptionalParam PatchClusterCustomObject Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -763,6 +809,11 @@ instance HasOptionalParam PatchClusterCustomObjectScale FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchClusterCustomObjectScale FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchClusterCustomObjectScale Force where instance HasOptionalParam PatchClusterCustomObjectScale Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -817,6 +868,11 @@ instance HasOptionalParam PatchClusterCustomObjectStatus FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchClusterCustomObjectStatus FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchClusterCustomObjectStatus Force where instance HasOptionalParam PatchClusterCustomObjectStatus Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -873,6 +929,11 @@ instance HasOptionalParam PatchNamespacedCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchNamespacedCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchNamespacedCustomObject Force where instance HasOptionalParam PatchNamespacedCustomObject Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -924,6 +985,11 @@ instance HasOptionalParam PatchNamespacedCustomObjectScale FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchNamespacedCustomObjectScale FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchNamespacedCustomObjectScale Force where instance HasOptionalParam PatchNamespacedCustomObjectScale Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -981,6 +1047,11 @@ instance HasOptionalParam PatchNamespacedCustomObjectStatus FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam PatchNamespacedCustomObjectStatus FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | /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/ "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.
instance HasOptionalParam PatchNamespacedCustomObjectStatus Force where instance HasOptionalParam PatchNamespacedCustomObjectStatus Force where
applyOptionalParam req (Force xs) = applyOptionalParam req (Force xs) =
@@ -1038,6 +1109,11 @@ instance HasOptionalParam ReplaceClusterCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceClusterCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceClusterCustomObject mtype instance MimeType mtype => Consumes ReplaceClusterCustomObject mtype
@@ -1081,6 +1157,11 @@ instance HasOptionalParam ReplaceClusterCustomObjectScale FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceClusterCustomObjectScale FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceClusterCustomObjectScale mtype instance MimeType mtype => Consumes ReplaceClusterCustomObjectScale mtype
@@ -1128,6 +1209,11 @@ instance HasOptionalParam ReplaceClusterCustomObjectStatus FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceClusterCustomObjectStatus FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceClusterCustomObjectStatus mtype instance MimeType mtype => Consumes ReplaceClusterCustomObjectStatus mtype
@@ -1177,6 +1263,11 @@ instance HasOptionalParam ReplaceNamespacedCustomObject FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceNamespacedCustomObject FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceNamespacedCustomObject mtype instance MimeType mtype => Consumes ReplaceNamespacedCustomObject mtype
@@ -1221,6 +1312,11 @@ instance HasOptionalParam ReplaceNamespacedCustomObjectScale FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceNamespacedCustomObjectScale FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceNamespacedCustomObjectScale mtype instance MimeType mtype => Consumes ReplaceNamespacedCustomObjectScale mtype
@@ -1269,6 +1365,11 @@ instance HasOptionalParam ReplaceNamespacedCustomObjectStatus FieldManager where
applyOptionalParam req (FieldManager xs) = applyOptionalParam req (FieldManager xs) =
req `addQuery` toQuery ("fieldManager", Just xs) req `addQuery` toQuery ("fieldManager", Just xs)
-- | /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)
instance HasOptionalParam ReplaceNamespacedCustomObjectStatus FieldValidation where
applyOptionalParam req (FieldValidation xs) =
req `addQuery` toQuery ("fieldValidation", Just xs)
-- | @*/*@ -- | @*/*@
instance MimeType mtype => Consumes ReplaceNamespacedCustomObjectStatus mtype instance MimeType mtype => Consumes ReplaceNamespacedCustomObjectStatus mtype

View File

@@ -59,7 +59,7 @@ import qualified Prelude as P
-- *** getServiceAccountIssuerOpenIDKeyset -- *** getServiceAccountIssuerOpenIDKeyset
-- | @GET \/openid\/v1\/jwks\/@ -- | @GET \/openid\/v1\/jwks@
-- --
-- get service account issuer OpenID JSON Web Key Set (contains public token verification keys) -- get service account issuer OpenID JSON Web Key Set (contains public token verification keys)
-- --
@@ -68,7 +68,7 @@ import qualified Prelude as P
getServiceAccountIssuerOpenIDKeyset getServiceAccountIssuerOpenIDKeyset
:: KubernetesRequest GetServiceAccountIssuerOpenIDKeyset MimeNoContent Text MimeJwkSetjson :: KubernetesRequest GetServiceAccountIssuerOpenIDKeyset MimeNoContent Text MimeJwkSetjson
getServiceAccountIssuerOpenIDKeyset = getServiceAccountIssuerOpenIDKeyset =
_mkRequest "GET" ["/openid/v1/jwks/"] _mkRequest "GET" ["/openid/v1/jwks"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken) `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
data GetServiceAccountIssuerOpenIDKeyset data GetServiceAccountIssuerOpenIDKeyset

View File

@@ -59,7 +59,7 @@ import qualified Prelude as P
-- *** getServiceAccountIssuerOpenIDConfiguration -- *** getServiceAccountIssuerOpenIDConfiguration
-- | @GET \/.well-known\/openid-configuration\/@ -- | @GET \/.well-known\/openid-configuration@
-- --
-- get service account issuer OpenID configuration, also known as the 'OIDC discovery doc' -- get service account issuer OpenID configuration, also known as the 'OIDC discovery doc'
-- --
@@ -68,7 +68,7 @@ import qualified Prelude as P
getServiceAccountIssuerOpenIDConfiguration getServiceAccountIssuerOpenIDConfiguration
:: KubernetesRequest GetServiceAccountIssuerOpenIDConfiguration MimeNoContent Text MimeJSON :: KubernetesRequest GetServiceAccountIssuerOpenIDConfiguration MimeNoContent Text MimeJSON
getServiceAccountIssuerOpenIDConfiguration = getServiceAccountIssuerOpenIDConfiguration =
_mkRequest "GET" ["/.well-known/openid-configuration/"] _mkRequest "GET" ["/.well-known/openid-configuration"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken) `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
data GetServiceAccountIssuerOpenIDConfiguration data GetServiceAccountIssuerOpenIDConfiguration

View File

@@ -50,6 +50,7 @@ import qualified Data.Maybe as P
import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Proxy as P (Proxy(..))
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Text.Encoding as T import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy.Encoding as TL
import qualified Data.Time as TI import qualified Data.Time as TI
import qualified Data.Time.ISO8601 as TI import qualified Data.Time.ISO8601 as TI
import qualified GHC.Base as P (Alternative) import qualified GHC.Base as P (Alternative)
@@ -339,6 +340,9 @@ toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem]
toQuery x = [(fmap . fmap) toQueryParam x] toQuery x = [(fmap . fmap) toQueryParam x]
where toQueryParam = T.encodeUtf8 . WH.toQueryParam where toQueryParam = T.encodeUtf8 . WH.toQueryParam
toJsonQuery :: A.ToJSON a => (BC.ByteString, Maybe a) -> [NH.QueryItem]
toJsonQuery = toQuery . (fmap . fmap) (TL.decodeUtf8 . A.encode)
toPartialEscapeQuery :: B.ByteString -> NH.Query -> NH.PartialEscapeQuery toPartialEscapeQuery :: B.ByteString -> NH.Query -> NH.PartialEscapeQuery
toPartialEscapeQuery extraUnreserved query = fmap (\(k, v) -> (k, maybe [] go v)) query toPartialEscapeQuery extraUnreserved query = fmap (\(k, v) -> (k, maybe [] go v)) query
where go :: B.ByteString -> [NH.EscapeItem] where go :: B.ByteString -> [NH.EscapeItem]
@@ -371,6 +375,9 @@ toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs
toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query
toQueryColl c xs = _toCollA c toQuery xs toQueryColl c xs = _toCollA c toQuery xs
toJsonQueryColl :: A.ToJSON a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query
toJsonQueryColl c xs = _toCollA c toJsonQuery xs
_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] _toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)]
_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) _toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs))
where fencode = fmap (fmap Just) . encode . fmap P.fromJust where fencode = fmap (fmap Just) . encode . fmap P.fromJust

View File

@@ -16,6 +16,7 @@ Module : Kubernetes.OpenAPI.Model
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE MultiParamTypeClasses #-}
@@ -97,6 +98,9 @@ newtype FieldManager = FieldManager { unFieldManager :: Text } deriving (P.Eq, P
-- ** FieldSelector -- ** FieldSelector
newtype FieldSelector = FieldSelector { unFieldSelector :: Text } deriving (P.Eq, P.Show) newtype FieldSelector = FieldSelector { unFieldSelector :: Text } deriving (P.Eq, P.Show)
-- ** FieldValidation
newtype FieldValidation = FieldValidation { unFieldValidation :: Text } deriving (P.Eq, P.Show)
-- ** Follow -- ** Follow
newtype Follow = Follow { unFollow :: Bool } deriving (P.Eq, P.Show) newtype Follow = Follow { unFollow :: Bool } deriving (P.Eq, P.Show)

Some files were not shown because too many files have changed in this diff Show More