Compare commits
	
		
			No commits in common. "4498be544b054aa35d742bff347c62ba12789f7a" and "deb73d06e64371b6947d2479b0e9ab2a5eab12d6" have entirely different histories.
		
	
	
		
			4498be544b
			...
			deb73d06e6
		
	
		
					 197 changed files with 11906 additions and 14665 deletions
				
			
		
							
								
								
									
										3
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -10,6 +10,3 @@ node_modules
 | 
				
			||||||
*.egg-info
 | 
					*.egg-info
 | 
				
			||||||
/.tox
 | 
					/.tox
 | 
				
			||||||
/dist
 | 
					/dist
 | 
				
			||||||
build
 | 
					 | 
				
			||||||
result
 | 
					 | 
				
			||||||
nixos.qcow2
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,6 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    "nixEnvSelector.suggestion": false,
 | 
					 | 
				
			||||||
    "nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
 | 
					 | 
				
			||||||
    "python.linting.mypyEnabled": true,
 | 
					 | 
				
			||||||
    "python.linting.enabled": true
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
recursive-include lenticular_cloud/template *
 | 
					recursive-include lenticular_cloud/template *
 | 
				
			||||||
recursive-include lenticular_cloud/static **
 | 
					recursive-include lenticular_cloud/static **
 | 
				
			||||||
recursive-include lenticular_cloud/migrations **
 | 
					recursive-include lenticular_cloud/migrations **
 | 
				
			||||||
include lenticular_cloud/*.toml
 | 
					include lenticular_cloud/*.cfg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										173
									
								
								default.nix
									
										
									
									
									
								
							
							
						
						
									
										173
									
								
								default.nix
									
										
									
									
									
								
							| 
						 | 
					@ -1,11 +1,164 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  pkgs,
 | 
				
			||||||
 | 
					  python ? pkgs.python310,
 | 
				
			||||||
 | 
					  nodejs ? pkgs.nodejs,
 | 
				
			||||||
 | 
					  ...}:
 | 
				
			||||||
 | 
					let 
 | 
				
			||||||
 | 
					  nixNodePackage = builtins.fetchGit {
 | 
				
			||||||
 | 
					    url = "https://github.com/mkg20001/nix-node-package.git";
 | 
				
			||||||
 | 
					    rev = "03285e212016db5f28530563b58cfcc5706ff73f";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  makeNode = import "${nixNodePackage}/nix/default.nix" pkgs {
 | 
				
			||||||
 | 
					    root = ./.;
 | 
				
			||||||
 | 
					    install = false;
 | 
				
			||||||
 | 
					    nodejs = nodejs;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  node-env = makeNode { };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(import
 | 
					  urlobject = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
  (
 | 
					    pname = "URLObject";
 | 
				
			||||||
    let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
 | 
					    version = "2.4.3";
 | 
				
			||||||
    fetchTarball {
 | 
					    src = fetchPypi {
 | 
				
			||||||
      url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
 | 
					      inherit pname version;
 | 
				
			||||||
      sha256 = lock.nodes.flake-compat.locked.narHash;
 | 
					      sha256 = "47b2e20e6ab9c8366b2f4a3566b6ff4053025dad311c4bb71279bbcfa2430caa";
 | 
				
			||||||
    }
 | 
					    };
 | 
				
			||||||
  )
 | 
					    doCheck = true;
 | 
				
			||||||
  { src = ./.; }
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
).defaultNix
 | 
					    ];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  python_attrs = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
 | 
					    pname = "attrs";
 | 
				
			||||||
 | 
					    version = "21.4.0";
 | 
				
			||||||
 | 
					    src = fetchPypi {
 | 
				
			||||||
 | 
					      inherit pname version;
 | 
				
			||||||
 | 
					      sha256 = "626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    #doCheck = true;
 | 
				
			||||||
 | 
					    doCheck = false;
 | 
				
			||||||
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  flask-dance = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
 | 
					    pname = "Flask-Dance";
 | 
				
			||||||
 | 
					    version = "6.0.0";
 | 
				
			||||||
 | 
					    src = fetchPypi {
 | 
				
			||||||
 | 
					      inherit pname version;
 | 
				
			||||||
 | 
					      sha256 = "15bb3c412eb789a2d904bfd0fd44aac2d94f82703a51d14123fd336136d55db0";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    doCheck = false;
 | 
				
			||||||
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
 | 
					      requests
 | 
				
			||||||
 | 
					      oauthlib
 | 
				
			||||||
 | 
					      requests_oauthlib
 | 
				
			||||||
 | 
					      flask
 | 
				
			||||||
 | 
					      urlobject
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    checkInputs = [
 | 
				
			||||||
 | 
					      pytest
 | 
				
			||||||
 | 
					      nose
 | 
				
			||||||
 | 
					      pytest-mock
 | 
				
			||||||
 | 
					      responses
 | 
				
			||||||
 | 
					      freezegun
 | 
				
			||||||
 | 
					      coverage
 | 
				
			||||||
 | 
					# testing sqlalchemy support
 | 
				
			||||||
 | 
					      sqlalchemy
 | 
				
			||||||
 | 
					      flask_sqlalchemy
 | 
				
			||||||
 | 
					# testing integration with other extensions
 | 
				
			||||||
 | 
					      flask_login
 | 
				
			||||||
 | 
					      flask-caching
 | 
				
			||||||
 | 
					      betamax
 | 
				
			||||||
 | 
					# we need the `signedtoken` extra for `oauthlib`
 | 
				
			||||||
 | 
					#      oauthlib[signedtoken]
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  ldap3-orm = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
 | 
					    pname = "ldap3-orm";
 | 
				
			||||||
 | 
					    version = "2.7.0";
 | 
				
			||||||
 | 
					    src = fetchPypi {
 | 
				
			||||||
 | 
					      inherit pname version;
 | 
				
			||||||
 | 
					      sha256 = "8783886d4ce90d66da61ce24619593a265b50f0de1fbebe86df95c6788661664";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    doCheck = false;
 | 
				
			||||||
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
 | 
					      ldap3
 | 
				
			||||||
 | 
					      six
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  u2flib-server = {};
 | 
				
			||||||
 | 
					  ory-hydra-client-old = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
 | 
					    pname = "ory-hydra-client";
 | 
				
			||||||
 | 
					    version = "1.10.6";
 | 
				
			||||||
 | 
					    src = fetchPypi {
 | 
				
			||||||
 | 
					      inherit pname version;
 | 
				
			||||||
 | 
					      sha256 = "57f877e55a8f202db27f5cbae9c55a1b1a91848ef46d0cbd3b710ef77882095c";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    doCheck = false;
 | 
				
			||||||
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
 | 
					      urllib3
 | 
				
			||||||
 | 
					      python-dateutil
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  ory-hydra-client = with python.pkgs; buildPythonPackage rec {
 | 
				
			||||||
 | 
					    pname = "ory-hydra-client";
 | 
				
			||||||
 | 
					    version = "1.9.2";
 | 
				
			||||||
 | 
					    src = ./libs/ory-hydra-client; 
 | 
				
			||||||
 | 
					#    doCheck = false;
 | 
				
			||||||
 | 
					    propagatedBuildInputs = [
 | 
				
			||||||
 | 
					      urllib3
 | 
				
			||||||
 | 
					      python-dateutil
 | 
				
			||||||
 | 
					      #python_attrs
 | 
				
			||||||
 | 
					      attrs
 | 
				
			||||||
 | 
					      httpx
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					in
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  nativeBuildInputs = with python.pkgs; [
 | 
				
			||||||
 | 
					      flask
 | 
				
			||||||
 | 
					      flask-restful
 | 
				
			||||||
 | 
					      flask_sqlalchemy
 | 
				
			||||||
 | 
					      flask_wtf
 | 
				
			||||||
 | 
					      flask-babel
 | 
				
			||||||
 | 
					      flask_login
 | 
				
			||||||
 | 
					      requests
 | 
				
			||||||
 | 
					      requests_oauthlib
 | 
				
			||||||
 | 
					      ldap3
 | 
				
			||||||
 | 
					      ldap3-orm
 | 
				
			||||||
 | 
					      pyotp
 | 
				
			||||||
 | 
					      cryptography
 | 
				
			||||||
 | 
					      blinker
 | 
				
			||||||
 | 
					      ory-hydra-client
 | 
				
			||||||
 | 
					      authlib # as oauth client lib
 | 
				
			||||||
 | 
					      fido2 # for webauthn
 | 
				
			||||||
 | 
					      flask_migrate # db migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      nodejs
 | 
				
			||||||
 | 
					      #node-env
 | 
				
			||||||
 | 
					      gunicorn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      flask-dance
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#python-u2flib-server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#flask-debug
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  testBuildInputs = with python.pkgs; [
 | 
				
			||||||
 | 
					    pytest
 | 
				
			||||||
 | 
					    pytest-mypy
 | 
				
			||||||
 | 
					    flask_testing
 | 
				
			||||||
 | 
					    tox
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    types-dateutil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    nose
 | 
				
			||||||
 | 
					    mypy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										118
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										118
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							| 
						 | 
					@ -1,118 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  "nodes": {
 | 
					 | 
				
			||||||
    "flake-compat": {
 | 
					 | 
				
			||||||
      "flake": false,
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1696426674,
 | 
					 | 
				
			||||||
        "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
 | 
					 | 
				
			||||||
        "owner": "edolstra",
 | 
					 | 
				
			||||||
        "repo": "flake-compat",
 | 
					 | 
				
			||||||
        "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "owner": "edolstra",
 | 
					 | 
				
			||||||
        "repo": "flake-compat",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "flake-utils": {
 | 
					 | 
				
			||||||
      "inputs": {
 | 
					 | 
				
			||||||
        "systems": "systems"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1694529238,
 | 
					 | 
				
			||||||
        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
 | 
					 | 
				
			||||||
        "owner": "numtide",
 | 
					 | 
				
			||||||
        "repo": "flake-utils",
 | 
					 | 
				
			||||||
        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "owner": "numtide",
 | 
					 | 
				
			||||||
        "repo": "flake-utils",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "nix-node-package": {
 | 
					 | 
				
			||||||
      "flake": false,
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1694372307,
 | 
					 | 
				
			||||||
        "narHash": "sha256-18dhHWJfa0QB0fPsaYvRwGd86BVn6xMkN6mDmiDKack=",
 | 
					 | 
				
			||||||
        "owner": "mkg20001",
 | 
					 | 
				
			||||||
        "repo": "nix-node-package",
 | 
					 | 
				
			||||||
        "rev": "97ac59276f12f768062e4eb336fc77079d5fb6a0",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "owner": "mkg20001",
 | 
					 | 
				
			||||||
        "repo": "nix-node-package",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "nixpkgs": {
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1697059129,
 | 
					 | 
				
			||||||
        "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=",
 | 
					 | 
				
			||||||
        "owner": "NixOS",
 | 
					 | 
				
			||||||
        "repo": "nixpkgs",
 | 
					 | 
				
			||||||
        "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "id": "nixpkgs",
 | 
					 | 
				
			||||||
        "ref": "nixos-unstable",
 | 
					 | 
				
			||||||
        "type": "indirect"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "root": {
 | 
					 | 
				
			||||||
      "inputs": {
 | 
					 | 
				
			||||||
        "flake-compat": "flake-compat",
 | 
					 | 
				
			||||||
        "flake-utils": "flake-utils",
 | 
					 | 
				
			||||||
        "nix-node-package": "nix-node-package",
 | 
					 | 
				
			||||||
        "nixpkgs": "nixpkgs",
 | 
					 | 
				
			||||||
        "tuxpkgs": "tuxpkgs"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "systems": {
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1681028828,
 | 
					 | 
				
			||||||
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
 | 
					 | 
				
			||||||
        "owner": "nix-systems",
 | 
					 | 
				
			||||||
        "repo": "default",
 | 
					 | 
				
			||||||
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "owner": "nix-systems",
 | 
					 | 
				
			||||||
        "repo": "default",
 | 
					 | 
				
			||||||
        "type": "github"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "tuxpkgs": {
 | 
					 | 
				
			||||||
      "inputs": {
 | 
					 | 
				
			||||||
        "flake-utils": [
 | 
					 | 
				
			||||||
          "flake-utils"
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        "nixpkgs": [
 | 
					 | 
				
			||||||
          "nixpkgs"
 | 
					 | 
				
			||||||
        ]
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "locked": {
 | 
					 | 
				
			||||||
        "lastModified": 1696700871,
 | 
					 | 
				
			||||||
        "narHash": "sha256-9VFEJEfnfnCS1+kLznxd+OiDYdMnLP00+XR53iPfnK4=",
 | 
					 | 
				
			||||||
        "ref": "refs/heads/master",
 | 
					 | 
				
			||||||
        "rev": "a25f5792a256beaed2a9f944fccdea8ea7a8d44b",
 | 
					 | 
				
			||||||
        "revCount": 6,
 | 
					 | 
				
			||||||
        "type": "git",
 | 
					 | 
				
			||||||
        "url": "ssh://git@git.o-g.at/nixpkg/tuxpkgs.git"
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "original": {
 | 
					 | 
				
			||||||
        "type": "git",
 | 
					 | 
				
			||||||
        "url": "ssh://git@git.o-g.at/nixpkg/tuxpkgs.git"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "root": "root",
 | 
					 | 
				
			||||||
  "version": 7
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										67
									
								
								flake.nix
									
										
									
									
									
								
							
							
						
						
									
										67
									
								
								flake.nix
									
										
									
									
									
								
							| 
						 | 
					@ -1,67 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  description = "Lenticular cloud interface";
 | 
					 | 
				
			||||||
  inputs = {
 | 
					 | 
				
			||||||
    nixpkgs.url = "nixpkgs/nixos-unstable";
 | 
					 | 
				
			||||||
    flake-utils.url = "github:numtide/flake-utils";
 | 
					 | 
				
			||||||
    flake-compat = { # for shell.nix
 | 
					 | 
				
			||||||
      url = "github:edolstra/flake-compat";
 | 
					 | 
				
			||||||
      flake = false;
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    nix-node-package = {
 | 
					 | 
				
			||||||
      url = "github:mkg20001/nix-node-package";
 | 
					 | 
				
			||||||
      flake = false;
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    tuxpkgs = {
 | 
					 | 
				
			||||||
      url = "git+ssh://git@git.o-g.at/nixpkg/tuxpkgs.git";
 | 
					 | 
				
			||||||
      inputs.nixpkgs.follows = "nixpkgs";
 | 
					 | 
				
			||||||
      inputs.flake-utils.follows = "flake-utils";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
  outputs = { self, nixpkgs, nix-node-package, flake-utils, tuxpkgs, ... }:
 | 
					 | 
				
			||||||
    flake-utils.lib.eachDefaultSystem (system: let
 | 
					 | 
				
			||||||
      pkgs = nixpkgs.legacyPackages.${system}.extend (import ./overlay.nix);
 | 
					 | 
				
			||||||
    in rec {
 | 
					 | 
				
			||||||
      formatter = pkgs.nixpkgs-fmt;
 | 
					 | 
				
			||||||
      devShells.default = pkgs.mkShell {packages = [
 | 
					 | 
				
			||||||
         (pkgs.python3.withPackages (ps: (
 | 
					 | 
				
			||||||
          pkgs.lenticular-cloud.propagatedBuildInputs ++
 | 
					 | 
				
			||||||
          pkgs.lenticular-cloud.testBuildInputs
 | 
					 | 
				
			||||||
        )))
 | 
					 | 
				
			||||||
      ];};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      packages.default = pkgs.lenticular-cloud;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      checks = {
 | 
					 | 
				
			||||||
        package = packages.default;
 | 
					 | 
				
			||||||
        devShells = devShells.default;
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
    }) // {
 | 
					 | 
				
			||||||
      nixosModules = {
 | 
					 | 
				
			||||||
        default = import ./module.nix;
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
      overlays.default = import ./overlay.nix;
 | 
					 | 
				
			||||||
      nixosConfigurations.testSystem = nixpkgs.lib.nixosSystem {
 | 
					 | 
				
			||||||
        system = "x86_64-linux";
 | 
					 | 
				
			||||||
        modules = [
 | 
					 | 
				
			||||||
          self.nixosModules.default
 | 
					 | 
				
			||||||
          tuxpkgs.nixosModules.ory-hydra
 | 
					 | 
				
			||||||
          "${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
 | 
					 | 
				
			||||||
          ({...}:{
 | 
					 | 
				
			||||||
            security.acme.acceptTerms = true;
 | 
					 | 
				
			||||||
            security.acme.defaults.email = "acme@example.com";
 | 
					 | 
				
			||||||
            services.lenticular-cloud = {
 | 
					 | 
				
			||||||
              enable = true;
 | 
					 | 
				
			||||||
              domain = "example.com";
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
            services.ory-hydra = {
 | 
					 | 
				
			||||||
              enable = true;
 | 
					 | 
				
			||||||
              admin_domain = "admin-hydra.local";
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
            networking.hosts = {"::1" = [ "admin-hydra.local" ]; };
 | 
					 | 
				
			||||||
            services.getty.autologinUser = "root";
 | 
					 | 
				
			||||||
            virtualisation.qemu.options = ["-vga none"];
 | 
					 | 
				
			||||||
          })
 | 
					 | 
				
			||||||
        ];
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,14 +1,11 @@
 | 
				
			||||||
from flask.app import Flask
 | 
					from flask.app import Flask
 | 
				
			||||||
from flask import g
 | 
					from flask import g, redirect, request
 | 
				
			||||||
from flask.json.provider import DefaultJSONProvider
 | 
					from flask.helpers import url_for
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
from lenticular_cloud.lenticular_services import lenticular_services
 | 
					from lenticular_cloud.lenticular_services import lenticular_services
 | 
				
			||||||
 | 
					from ory_hydra_client import Client
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import toml
 | 
					 | 
				
			||||||
import json
 | 
					 | 
				
			||||||
import logging
 | 
					 | 
				
			||||||
from uuid import UUID
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +15,6 @@ from .translations import init_babel
 | 
				
			||||||
from .model import db, migrate
 | 
					from .model import db, migrate
 | 
				
			||||||
from .views import auth_views, frontend_views, init_login_manager, api_views, pki_views, admin_views, oauth2_views
 | 
					from .views import auth_views, frontend_views, init_login_manager, api_views, pki_views, admin_views, oauth2_views
 | 
				
			||||||
 | 
					
 | 
				
			||||||
logger = logging.getLogger(__name__)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_git_hash():
 | 
					def get_git_hash():
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
| 
						 | 
					@ -27,33 +23,13 @@ def get_git_hash():
 | 
				
			||||||
        return ''
 | 
					        return ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def create_app() -> Flask:
 | 
				
			||||||
class CustomJSONEncoder(DefaultJSONProvider):
 | 
					 | 
				
			||||||
    def default(self, obj):
 | 
					 | 
				
			||||||
        if isinstance(obj, UUID):
 | 
					 | 
				
			||||||
            # if the obj is uuid, we simply return the value of uuid
 | 
					 | 
				
			||||||
            return obj.hex
 | 
					 | 
				
			||||||
        return super().default(obj)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def create_app_raw(config_files: list[Path]) -> Flask:
 | 
					 | 
				
			||||||
    name = "lenticular_cloud"
 | 
					    name = "lenticular_cloud"
 | 
				
			||||||
    app = Flask(name, template_folder='template')
 | 
					    app = Flask(name, template_folder='template')
 | 
				
			||||||
    app.json_provider_class = CustomJSONEncoder
 | 
					    app.config.from_pyfile('application.cfg')
 | 
				
			||||||
    
 | 
					    active_cfg = os.getenv('CONFIG_FILE', 'production.cfg')
 | 
				
			||||||
    # config
 | 
					    app.config.from_pyfile(active_cfg)
 | 
				
			||||||
    app.config.from_file('config_development.toml', toml.load)
 | 
					
 | 
				
			||||||
    for config_file in config_files:
 | 
					 | 
				
			||||||
        active_cfg = str(config_file.absolute())
 | 
					 | 
				
			||||||
        if active_cfg.endswith(".toml"):
 | 
					 | 
				
			||||||
            logger.info(f"load toml config file from {active_cfg}")
 | 
					 | 
				
			||||||
            app.config.from_file(active_cfg, toml.load)
 | 
					 | 
				
			||||||
        elif active_cfg.endswith(".json"):
 | 
					 | 
				
			||||||
            logger.info(f"load json config file from {active_cfg}")
 | 
					 | 
				
			||||||
            app.config.from_file(active_cfg, json.load)
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            logger.info(f"load pyfile config file from {active_cfg}")
 | 
					 | 
				
			||||||
            app.config.from_pyfile(active_cfg)
 | 
					 | 
				
			||||||
    app.jinja_env.globals['GIT_HASH'] = get_git_hash()
 | 
					    app.jinja_env.globals['GIT_HASH'] = get_git_hash()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    db.init_app(app)
 | 
					    db.init_app(app)
 | 
				
			||||||
| 
						 | 
					@ -69,9 +45,9 @@ def create_app_raw(config_files: list[Path]) -> Flask:
 | 
				
			||||||
#                        host=app.config['HYDRA_ADMIN_URL'],
 | 
					#                        host=app.config['HYDRA_ADMIN_URL'],
 | 
				
			||||||
#                        username=app.config['HYDRA_ADMIN_USER'],
 | 
					#                        username=app.config['HYDRA_ADMIN_USER'],
 | 
				
			||||||
#                        password=app.config['HYDRA_ADMIN_PASSWORD'])
 | 
					#                        password=app.config['HYDRA_ADMIN_PASSWORD'])
 | 
				
			||||||
    hydra_service.init_app(app)
 | 
					    hydra_service.set_hydra_client(Client(base_url=app.config['HYDRA_ADMIN_URL']))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    init_login_manager(app) # has to be after hydra_service
 | 
					    init_login_manager(app)
 | 
				
			||||||
    app.register_blueprint(auth_views)
 | 
					    app.register_blueprint(auth_views)
 | 
				
			||||||
    app.register_blueprint(frontend_views)
 | 
					    app.register_blueprint(frontend_views)
 | 
				
			||||||
    app.register_blueprint(api_views)
 | 
					    app.register_blueprint(api_views)
 | 
				
			||||||
| 
						 | 
					@ -90,12 +66,3 @@ def create_app_raw(config_files: list[Path]) -> Flask:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return app
 | 
					    return app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
def create_app() -> Flask:
 | 
					 | 
				
			||||||
    evn_var = os.getenv('CONFIG_FILE', None)
 | 
					 | 
				
			||||||
    if isinstance(evn_var, str):
 | 
					 | 
				
			||||||
        active_cfgs = list(map(Path, evn_var.split(':')))
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        active_cfgs = [ Path() / 'production.toml' ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return create_app_raw(active_cfgs)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -6,11 +6,16 @@ PREFERRED_URL_SCHEME = 'https'
 | 
				
			||||||
DATA_FOLDER = "../data"
 | 
					DATA_FOLDER = "../data"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SCRIPT_LOCATION="lenticular_cloud:migrations"
 | 
					SCRIPT_LOCATION="lenticular_cloud:migrations"
 | 
				
			||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///../data/db.sqlite'
 | 
					SQLALCHEMY_DATABASE_URI = f'sqlite:///{DATA_FOLDER}/db.sqlite'
 | 
				
			||||||
SQLALCHEMY_TRACK_MODIFICATIONS = false
 | 
					SQLALCHEMY_TRACK_MODIFICATIONS=False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LDAP_URL = 'ldaps://ldap.example.org'
 | 
				
			||||||
 | 
					LDAP_BASE_DN = 'dc=example,dc=com'
 | 
				
			||||||
 | 
					LDAP_BIND_DN = 'cn=admin,' + LDAP_BASE_DN
 | 
				
			||||||
 | 
					LDAP_BIND_PW = '123456'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PKI_PATH = "../data/pki"
 | 
					PKI_PATH = f'{DATA_FOLDER}/pki'
 | 
				
			||||||
DOMAIN = 'example.com'
 | 
					DOMAIN = 'example.com'
 | 
				
			||||||
#SERVER_NAME = f'account.{ DOMAIN }:9090'
 | 
					#SERVER_NAME = f'account.{ DOMAIN }:9090'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,24 +30,17 @@ OAUTH_ID = 'identiy_provider'
 | 
				
			||||||
OAUTH_SECRET = 'ThisIsNotSafe'
 | 
					OAUTH_SECRET = 'ThisIsNotSafe'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[LENTICULAR_CLOUD_SERVICES.jabber]
 | 
					 | 
				
			||||||
app_token = true
 | 
					 | 
				
			||||||
# client_cert= true
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LENTICULAR_CLOUD_SERVICES = {
 | 
				
			||||||
[LENTICULAR_CLOUD_SERVICES.mail-cardav]
 | 
						'jabber': {
 | 
				
			||||||
app_token = true
 | 
							'client_cert': True,
 | 
				
			||||||
 | 
							'pki_config':{
 | 
				
			||||||
# LENTICULAR_CLOUD_SERVICES = {
 | 
								'email': '{username}@jabber.{domain}'
 | 
				
			||||||
# 	'jabber': {
 | 
							},
 | 
				
			||||||
# 		'client_cert': True,
 | 
					    'app_token': True
 | 
				
			||||||
# 		'pki_config':{
 | 
						},
 | 
				
			||||||
# 			'email': '{username}@jabber.{domain}'
 | 
						'mail-cardav': {
 | 
				
			||||||
# 		},
 | 
							'client_cert': False,
 | 
				
			||||||
#     'app_token': True
 | 
					    'app_token': True
 | 
				
			||||||
# 	},
 | 
						}
 | 
				
			||||||
# 	'mail-cardav': {
 | 
					}
 | 
				
			||||||
# 		'client_cert': False,
 | 
					 | 
				
			||||||
#     'app_token': True
 | 
					 | 
				
			||||||
# 	}
 | 
					 | 
				
			||||||
# }
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
import argparse
 | 
					import argparse
 | 
				
			||||||
from typing import Optional
 | 
					 | 
				
			||||||
from .model import db, User
 | 
					from .model import db, User
 | 
				
			||||||
from .app import create_app
 | 
					from .app import create_app
 | 
				
			||||||
from werkzeug.middleware.proxy_fix import ProxyFix
 | 
					from werkzeug.middleware.proxy_fix import ProxyFix
 | 
				
			||||||
| 
						 | 
					@ -65,7 +64,7 @@ def cli_signup(args) -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if args.signup_id is not None:
 | 
					    if args.signup_id is not None:
 | 
				
			||||||
        user = User.query.get(args.signup_id)
 | 
					        user = User.query.get(args.signup_id)
 | 
				
			||||||
        if user is None:
 | 
					        if user == None:
 | 
				
			||||||
            print("user not found")
 | 
					            print("user not found")
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        user.enabled = True
 | 
					        user.enabled = True
 | 
				
			||||||
| 
						 | 
					@ -88,7 +87,7 @@ def cli_run(app: Flask, args) -> None:
 | 
				
			||||||
def cli_db_upgrade(args) -> None:
 | 
					def cli_db_upgrade(args) -> None:
 | 
				
			||||||
    app = create_app()
 | 
					    app = create_app()
 | 
				
			||||||
    migration_dir = Path(app.root_path) / 'migrations'
 | 
					    migration_dir = Path(app.root_path) / 'migrations'
 | 
				
			||||||
    upgrade( str(migration_dir), revision='head' )
 | 
					    upgrade( str(migration_dir) )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,6 @@ class TOTPDeleteForm(FlaskForm):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AppTokenForm(FlaskForm):
 | 
					class AppTokenForm(FlaskForm):
 | 
				
			||||||
    name = StringField(gettext('name'), validators=[DataRequired(),Length(min=1, max=255) ])
 | 
					    name = StringField(gettext('name'), validators=[DataRequired(),Length(min=1, max=255) ])
 | 
				
			||||||
    scopes = StringField(gettext('scopes'), validators=[DataRequired(),Length(min=1, max=255) ])
 | 
					 | 
				
			||||||
    submit = SubmitField(gettext('Activate'))
 | 
					    submit = SubmitField(gettext('Activate'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AppTokenDeleteForm(FlaskForm):
 | 
					class AppTokenDeleteForm(FlaskForm):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,55 +1,13 @@
 | 
				
			||||||
from flask import Flask
 | 
					 | 
				
			||||||
from ory_hydra_client import Client
 | 
					from ory_hydra_client import Client
 | 
				
			||||||
from typing import Optional
 | 
					from typing import Optional
 | 
				
			||||||
from ory_hydra_client.api.o_auth_2 import list_o_auth_2_clients, create_o_auth_2_client
 | 
					
 | 
				
			||||||
from ory_hydra_client.models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class HydraService:
 | 
					class HydraService:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self) -> None:
 | 
					    def __init__(self):
 | 
				
			||||||
        self._hydra_client: Optional[Client] = None
 | 
					        self._hydra_client = None # type: Optional[Client]
 | 
				
			||||||
        self._oauth_client: Optional[Client] = None
 | 
					        self._oauth_client = None # type: Optional[Client]
 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.client_id = ''
 | 
					 | 
				
			||||||
        self.client_secret = ''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def init_app(self, app: Flask) -> None:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        self.set_hydra_client(Client(base_url=app.config['HYDRA_ADMIN_URL']))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        client_name = app.config['OAUTH_ID']
 | 
					 | 
				
			||||||
        client_secret = app.config['OAUTH_SECRET']
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        clients = list_o_auth_2_clients.sync_detailed(_client=self.hydra_client).parsed
 | 
					 | 
				
			||||||
        if clients is None:
 | 
					 | 
				
			||||||
            raise RuntimeError("could not get clients list")
 | 
					 | 
				
			||||||
        client: Optional[OAuth20Client] = None
 | 
					 | 
				
			||||||
        for c in clients:
 | 
					 | 
				
			||||||
            if c.client_name == client_name:
 | 
					 | 
				
			||||||
                client = c
 | 
					 | 
				
			||||||
                break
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if client is None:
 | 
					 | 
				
			||||||
            domain = app.config['DOMAIN']
 | 
					 | 
				
			||||||
            client = OAuth20Client(
 | 
					 | 
				
			||||||
                client_name="identiy_provider",
 | 
					 | 
				
			||||||
                # client_id=client_id,
 | 
					 | 
				
			||||||
                client_secret=client_secret,
 | 
					 | 
				
			||||||
                response_types=["code", "id_token"],
 | 
					 | 
				
			||||||
                scope="openid profile manage",
 | 
					 | 
				
			||||||
                grant_types=["authorization_code", "refresh_token"],
 | 
					 | 
				
			||||||
                redirect_uris=[ f"https://{domain}/oauth/authorized" ],
 | 
					 | 
				
			||||||
                token_endpoint_auth_method="client_secret_basic",
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
            ret = create_o_auth_2_client.sync(json_body=client, _client=self.hydra_client)
 | 
					 | 
				
			||||||
            if ret is None:
 | 
					 | 
				
			||||||
                raise RuntimeError("could not crate account")
 | 
					 | 
				
			||||||
        if type(client.client_id) is not str:
 | 
					 | 
				
			||||||
            raise RuntimeError("could not parse client_id from ory-hydra")
 | 
					 | 
				
			||||||
        self.client_id = client.client_id
 | 
					 | 
				
			||||||
        self.client_secret = client_secret
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def hydra_client(self) -> Client:
 | 
					    def hydra_client(self) -> Client:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,9 @@ from alembic import op
 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from flask import current_app
 | 
					from flask import current_app
 | 
				
			||||||
from lenticular_cloud.model import User
 | 
					from lenticular_cloud.model import User
 | 
				
			||||||
 | 
					from ldap3_orm import AttrDef, EntryBase as _EntryBase, ObjectDef, EntryType
 | 
				
			||||||
 | 
					from ldap3_orm import Reader
 | 
				
			||||||
 | 
					from ldap3 import Connection, Server, ALL
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +23,14 @@ depends_on = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def upgrade():
 | 
					def upgrade():
 | 
				
			||||||
 | 
					    app = current_app
 | 
				
			||||||
 | 
					    server = Server(app.config['LDAP_URL'], get_info=ALL)
 | 
				
			||||||
 | 
					    ldap_conn = Connection(server, app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PW'], auto_bind=True) # TODO auto_bind read docu
 | 
				
			||||||
 | 
					    base_dn = app.config['LDAP_BASE_DN']
 | 
				
			||||||
 | 
					    object_def = ObjectDef(["inetOrgPerson"], ldap_conn)
 | 
				
			||||||
 | 
					    user_base_dn = f"ou=users,{base_dn}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
					    # ### commands auto generated by Alembic - please adjust! ###
 | 
				
			||||||
    op.create_table('app_token',
 | 
					    op.create_table('app_token',
 | 
				
			||||||
    sa.Column('id', sa.Integer(), nullable=False),
 | 
					    sa.Column('id', sa.Integer(), nullable=False),
 | 
				
			||||||
| 
						 | 
					@ -38,36 +49,21 @@ def upgrade():
 | 
				
			||||||
    op.add_column('user', sa.Column('password_hashed', sa.String(), server_default="", nullable=False))
 | 
					    op.add_column('user', sa.Column('password_hashed', sa.String(), server_default="", nullable=False))
 | 
				
			||||||
    op.add_column('user', sa.Column('enabled', sa.Boolean(), server_default="false", nullable=True))
 | 
					    op.add_column('user', sa.Column('enabled', sa.Boolean(), server_default="false", nullable=True))
 | 
				
			||||||
    # ### end Alembic commands ###
 | 
					    # ### end Alembic commands ###
 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        from ldap3_orm import AttrDef, EntryBase as _EntryBase, ObjectDef, EntryType
 | 
					 | 
				
			||||||
        from ldap3_orm import Reader
 | 
					 | 
				
			||||||
        from ldap3 import Connection, Server, ALL
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        app = current_app
 | 
					    op.execute(User.__table__.update().values({'enabled': True}))
 | 
				
			||||||
        server = Server(app.config['LDAP_URL'], get_info=ALL)
 | 
					    conn = op.get_bind()
 | 
				
			||||||
        ldap_conn = Connection(server, app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PW'], auto_bind=True) # TODO auto_bind read docu
 | 
					    users = conn.execute(User.__table__.select())
 | 
				
			||||||
        base_dn = app.config['LDAP_BASE_DN']
 | 
					 | 
				
			||||||
        object_def = ObjectDef(["inetOrgPerson"], ldap_conn)
 | 
					 | 
				
			||||||
        user_base_dn = f"ou=users,{base_dn}"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for user in users:
 | 
				
			||||||
 | 
					        print(f"migrating user {user.username}")
 | 
				
			||||||
        op.execute(User.__table__.update().values({'enabled': True}))
 | 
					        reader = Reader(ldap_conn, object_def, user_base_dn, f'(uid={user.username})')
 | 
				
			||||||
        conn = op.get_bind()
 | 
					        result = reader.search()
 | 
				
			||||||
        users = conn.execute(User.__table__.select())
 | 
					        if len(result) == 0:
 | 
				
			||||||
 | 
					            print(f"WARNING: could not migrate user {user.username}")
 | 
				
			||||||
        for user in users:
 | 
					            continue
 | 
				
			||||||
            print(f"migrating user {user.username}")
 | 
					        ldap_object = result[0]
 | 
				
			||||||
            reader = Reader(ldap_conn, object_def, user_base_dn, f'(uid={user.username})')
 | 
					        password_hashed = ldap_object.userPassword[0].decode().replace('{CRYPT}','')
 | 
				
			||||||
            result = reader.search()
 | 
					        op.execute(User.__table__.update().values({'password_hashed': password_hashed}).where(User.id == user.id))
 | 
				
			||||||
            if len(result) == 0:
 | 
					 | 
				
			||||||
                print(f"WARNING: could not migrate user {user.username}")
 | 
					 | 
				
			||||||
                continue
 | 
					 | 
				
			||||||
            ldap_object = result[0]
 | 
					 | 
				
			||||||
            password_hashed = ldap_object.userPassword[0].decode().replace('{CRYPT}','')
 | 
					 | 
				
			||||||
            op.execute(User.__table__.update().values({'password_hashed': password_hashed}).where(User.id == user.id))
 | 
					 | 
				
			||||||
    except ModuleNotFoundError:
 | 
					 | 
				
			||||||
        print("ignore import warning")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,10 +18,10 @@ depends_on = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def upgrade():
 | 
					def upgrade():
 | 
				
			||||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
					    # ### commands auto generated by Alembic - please adjust! ###
 | 
				
			||||||
    with op.batch_alter_table('app_token') as batch_op:
 | 
					    op.add_column('app_token', sa.Column('user_id', sa.String(length=36), nullable=False))
 | 
				
			||||||
        batch_op.add_column(sa.Column('user_id', sa.Uuid, nullable=False))
 | 
					    op.add_column('app_token', sa.Column('last_used', sa.DateTime(), nullable=True))
 | 
				
			||||||
        batch_op.add_column(sa.Column('last_used', sa.DateTime(), nullable=True))
 | 
					 | 
				
			||||||
    op.create_foreign_key(None, 'app_token', 'user', ['user_id'], ['id'])
 | 
					    op.create_foreign_key(None, 'app_token', 'user', ['user_id'], ['id'])
 | 
				
			||||||
 | 
					    op.add_column('totp', sa.Column('last_used', sa.DateTime(), nullable=True))
 | 
				
			||||||
    tmp_table = sa.Table('_alembic_tmp_user', sa.MetaData())
 | 
					    tmp_table = sa.Table('_alembic_tmp_user', sa.MetaData())
 | 
				
			||||||
    op.execute(sa.schema.DropTable(tmp_table, if_exists=True))
 | 
					    op.execute(sa.schema.DropTable(tmp_table, if_exists=True))
 | 
				
			||||||
    with op.batch_alter_table('user') as batch_op:
 | 
					    with op.batch_alter_table('user') as batch_op:
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@ def upgrade():
 | 
				
			||||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
					    # ### commands auto generated by Alembic - please adjust! ###
 | 
				
			||||||
    op.create_table('webauthn_credential',
 | 
					    op.create_table('webauthn_credential',
 | 
				
			||||||
    sa.Column('id', sa.Integer(), nullable=False),
 | 
					    sa.Column('id', sa.Integer(), nullable=False),
 | 
				
			||||||
    sa.Column('user_id', sa.Uuid(), nullable=False),
 | 
					    sa.Column('user_id', sa.String(length=36), nullable=False),
 | 
				
			||||||
    sa.Column('user_handle', sa.String(length=64), nullable=False),
 | 
					    sa.Column('user_handle', sa.String(length=64), nullable=False),
 | 
				
			||||||
    sa.Column('credential_data', sa.LargeBinary(), nullable=False),
 | 
					    sa.Column('credential_data', sa.LargeBinary(), nullable=False),
 | 
				
			||||||
    sa.Column('name', sa.String(length=250), nullable=True),
 | 
					    sa.Column('name', sa.String(length=250), nullable=True),
 | 
				
			||||||
| 
						 | 
					@ -1,63 +0,0 @@
 | 
				
			||||||
"""init
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Revision ID: a74320a5d7a1
 | 
					 | 
				
			||||||
Revises: 
 | 
					 | 
				
			||||||
Create Date: 2023-10-01 20:15:53.795636
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
"""
 | 
					 | 
				
			||||||
from alembic import op
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# revision identifiers, used by Alembic.
 | 
					 | 
				
			||||||
revision = 'a74320a5d7a1'
 | 
					 | 
				
			||||||
down_revision = None
 | 
					 | 
				
			||||||
branch_labels = None
 | 
					 | 
				
			||||||
depends_on = None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def upgrade():
 | 
					 | 
				
			||||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
					 | 
				
			||||||
    op.create_table('group',
 | 
					 | 
				
			||||||
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('name', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('created_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('modified_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.PrimaryKeyConstraint('id'),
 | 
					 | 
				
			||||||
    sa.UniqueConstraint('name')
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    op.create_table('user',
 | 
					 | 
				
			||||||
    sa.Column('id', sa.Uuid(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('username', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('password_hashed', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('alternative_email', sa.String(), nullable=True),
 | 
					 | 
				
			||||||
    sa.Column('last_login', sa.DateTime(), nullable=True),
 | 
					 | 
				
			||||||
    sa.Column('enabled', sa.Boolean(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('created_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('modified_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.PrimaryKeyConstraint('id'),
 | 
					 | 
				
			||||||
    sa.UniqueConstraint('username')
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    op.create_table('app_token',
 | 
					 | 
				
			||||||
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('scopes', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('user_id', sa.Uuid(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('token', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('name', sa.String(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('last_used', sa.DateTime(), nullable=True),
 | 
					 | 
				
			||||||
    sa.Column('created_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.Column('modified_at', sa.DateTime(), nullable=False),
 | 
					 | 
				
			||||||
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
 | 
					 | 
				
			||||||
    sa.PrimaryKeyConstraint('id')
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    # ### end Alembic commands ###
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def downgrade():
 | 
					 | 
				
			||||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
					 | 
				
			||||||
    op.drop_table('webauthn_credential')
 | 
					 | 
				
			||||||
    op.drop_table('totp')
 | 
					 | 
				
			||||||
    op.drop_table('app_token')
 | 
					 | 
				
			||||||
    op.drop_table('user')
 | 
					 | 
				
			||||||
    op.drop_table('group')
 | 
					 | 
				
			||||||
    # ### end Alembic commands ###
 | 
					 | 
				
			||||||
| 
						 | 
					@ -11,15 +11,12 @@ import logging
 | 
				
			||||||
import crypt
 | 
					import crypt
 | 
				
			||||||
import secrets
 | 
					import secrets
 | 
				
			||||||
import string
 | 
					import string
 | 
				
			||||||
from sqlalchemy import null
 | 
					from flask_sqlalchemy import SQLAlchemy, orm
 | 
				
			||||||
from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass, Mapped, mapped_column, relationship, declarative_base
 | 
					 | 
				
			||||||
from flask_sqlalchemy import SQLAlchemy
 | 
					 | 
				
			||||||
from flask_sqlalchemy.model import Model, DefaultMeta
 | 
					 | 
				
			||||||
from flask_sqlalchemy.extension import _FSAModel
 | 
					 | 
				
			||||||
from flask_migrate import Migrate
 | 
					from flask_migrate import Migrate
 | 
				
			||||||
from datetime import datetime
 | 
					from datetime import datetime
 | 
				
			||||||
import uuid
 | 
					import uuid
 | 
				
			||||||
from typing import Iterator, Optional, List, Dict, Tuple, Any, Type, TYPE_CHECKING
 | 
					import pyotp
 | 
				
			||||||
 | 
					from typing import Optional, Callable
 | 
				
			||||||
from cryptography.x509 import Certificate as CertificateObj
 | 
					from cryptography.x509 import Certificate as CertificateObj
 | 
				
			||||||
from sqlalchemy.ext.declarative import DeclarativeMeta
 | 
					from sqlalchemy.ext.declarative import DeclarativeMeta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,18 +28,8 @@ logger = logging.getLogger(__name__)
 | 
				
			||||||
db = SQLAlchemy()
 | 
					db = SQLAlchemy()
 | 
				
			||||||
migrate = Migrate()
 | 
					migrate = Migrate()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BaseModelIntern(MappedAsDataclass, DeclarativeBase):
 | 
					 | 
				
			||||||
    pass
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if TYPE_CHECKING:
 | 
					BaseModel: DeclarativeMeta = db.Model
 | 
				
			||||||
    class BaseModel (_FSAModel,BaseModelIntern):
 | 
					 | 
				
			||||||
        pass
 | 
					 | 
				
			||||||
else:
 | 
					 | 
				
			||||||
    BaseModel: Type[_FSAModel] = db.Model
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class ModelUpdatedMixin:
 | 
					 | 
				
			||||||
    created_at: Mapped[datetime] = mapped_column(db.DateTime, default=datetime.now(), nullable=False)
 | 
					 | 
				
			||||||
    modified_at: Mapped[datetime] = mapped_column(db.DateTime, default=datetime.now(), onupdate=datetime.now, nullable=False)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SecurityUser(UserMixin):
 | 
					class SecurityUser(UserMixin):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -153,27 +140,28 @@ def generate_uuid():
 | 
				
			||||||
    return str(uuid.uuid4())
 | 
					    return str(uuid.uuid4())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class User(BaseModel, ModelUpdatedMixin):
 | 
					class User(BaseModel):
 | 
				
			||||||
    id: Mapped[uuid.UUID] = mapped_column(db.Uuid, primary_key=True, default=uuid.uuid4)
 | 
					    id = db.Column(
 | 
				
			||||||
    username: Mapped[str] = mapped_column(db.String, unique=True, nullable=False)
 | 
					            db.String(length=36), primary_key=True, default=generate_uuid)
 | 
				
			||||||
    password_hashed: Mapped[str] = mapped_column(db.String, nullable=False)
 | 
					    username = db.Column(
 | 
				
			||||||
    alternative_email: Mapped[Optional[str]] = mapped_column( db.String, nullable=True)
 | 
					            db.String, unique=True, nullable=False)
 | 
				
			||||||
    last_login: Mapped[Optional[datetime]] = mapped_column(db.DateTime, nullable=True)
 | 
					    password_hashed = db.Column(
 | 
				
			||||||
 | 
					            db.String, nullable=False)
 | 
				
			||||||
 | 
					    alternative_email = db.Column(
 | 
				
			||||||
 | 
					            db.String, nullable=True)
 | 
				
			||||||
 | 
					    created_at = db.Column(db.DateTime, nullable=False,
 | 
				
			||||||
 | 
					                            default=datetime.now)
 | 
				
			||||||
 | 
					    modified_at = db.Column(db.DateTime, nullable=False,
 | 
				
			||||||
 | 
					                            default=datetime.now, onupdate=datetime.now)
 | 
				
			||||||
 | 
					    last_login = db.Column(db.DateTime, nullable=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    enabled: Mapped[bool] = mapped_column(db.Boolean, nullable=False, default=False)
 | 
					    enabled = db.Column(db.Boolean, nullable=False, default=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    app_tokens: Mapped[List['AppToken']] = relationship('AppToken', back_populates='user')
 | 
					    app_tokens = db.relationship('AppToken', back_populates='user')
 | 
				
			||||||
    # totps: Mapped[List['Totp']] = relationship('Totp', back_populates='user', default_factory=list)
 | 
					    totps = db.relationship('Totp', back_populates='user')
 | 
				
			||||||
    # webauthn_credentials: Mapped[List['WebauthnCredential']] = relationship('WebauthnCredential', back_populates='user', cascade='delete,delete-orphan', passive_deletes=True, default_factory=list)
 | 
					    webauthn_credentials = db.relationship('WebauthnCredential', back_populates='user', cascade='delete,delete-orphan', passive_deletes=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    def __init__(self, **kwargs):
 | 
				
			||||||
    def totps(self) -> List['Totp']:
 | 
					 | 
				
			||||||
        return []
 | 
					 | 
				
			||||||
    @property
 | 
					 | 
				
			||||||
    def webauthn_credentials(self) -> List['WebauthnCredential']:
 | 
					 | 
				
			||||||
        return []
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def __init__(self, **kwargs) -> None:
 | 
					 | 
				
			||||||
        super().__init__(**kwargs)
 | 
					        super().__init__(**kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					@ -198,66 +186,66 @@ class User(BaseModel, ModelUpdatedMixin):
 | 
				
			||||||
    def change_password(self, password_new: str) -> None:
 | 
					    def change_password(self, password_new: str) -> None:
 | 
				
			||||||
        self.password_hashed = crypt.crypt(password_new)
 | 
					        self.password_hashed = crypt.crypt(password_new)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_token_by_name(self, name: str) -> Optional['AppToken']:
 | 
					    def get_tokens_by_service(self, service: Service) -> list['AppToken']:
 | 
				
			||||||
 | 
					        return [ token for token in self.app_tokens if token.service_name == service.name ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_token(self, service: Service, name: str) -> Optional['AppToken']:
 | 
				
			||||||
        for token in self.app_tokens:
 | 
					        for token in self.app_tokens:
 | 
				
			||||||
            if token.name == name:
 | 
					            if token.service_name == service.name and token.name == name:
 | 
				
			||||||
                return token
 | 
					                return token # type: ignore
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def get_token_by_scope(self, scope: str) -> Iterator['AppToken']:
 | 
					 | 
				
			||||||
        for token in self.app_tokens:
 | 
					 | 
				
			||||||
            if scope in token.scopes.split():
 | 
					 | 
				
			||||||
                yield token # type: ignore
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AppToken(BaseModel, ModelUpdatedMixin):
 | 
					class AppToken(BaseModel):
 | 
				
			||||||
    id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
 | 
					    id = db.Column(db.Integer, primary_key=True)
 | 
				
			||||||
    scopes: Mapped[str] = mapped_column(nullable=False) # string of a list seperated by `,` 
 | 
					    service_name = db.Column(db.String, nullable=False)
 | 
				
			||||||
    user_id: Mapped[uuid.UUID] = mapped_column(
 | 
					    user_id = db.Column(
 | 
				
			||||||
            db.Uuid,
 | 
					            db.String(length=36),
 | 
				
			||||||
            db.ForeignKey(User.id), nullable=False)
 | 
					            db.ForeignKey(User.id), nullable=False)
 | 
				
			||||||
    user: Mapped[User] = relationship(User, back_populates="app_tokens")
 | 
					    user = db.relationship(User)
 | 
				
			||||||
    token: Mapped[str] = mapped_column(nullable=False)
 | 
					    token = db.Column(db.String, nullable=False)
 | 
				
			||||||
    name: Mapped[str] = mapped_column(nullable=False)
 | 
					    name = db.Column(db.String, nullable=False)
 | 
				
			||||||
    last_used: Mapped[Optional[datetime]] = mapped_column(db.DateTime, nullable=True, default=None)
 | 
					    last_used = db.Column(db.DateTime, nullable=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def new(user: User, scopes: str, name: str):
 | 
					    def new(service: Service):
 | 
				
			||||||
 | 
					        app_token = AppToken()
 | 
				
			||||||
 | 
					        app_token.service_name = service.name
 | 
				
			||||||
        alphabet = string.ascii_letters + string.digits
 | 
					        alphabet = string.ascii_letters + string.digits
 | 
				
			||||||
        token = ''.join(secrets.choice(alphabet) for i in range(12))
 | 
					        app_token.token = ''.join(secrets.choice(alphabet) for i in range(12))
 | 
				
			||||||
        return AppToken(scopes=scopes, token=token, user=user, name=name)
 | 
					        return app_token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Totp(BaseModel, ModelUpdatedMixin):
 | 
					class Totp(BaseModel):
 | 
				
			||||||
    id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
 | 
					    id = db.Column(db.Integer, primary_key=True)
 | 
				
			||||||
    secret: Mapped[str] = mapped_column(db.String, nullable=False)
 | 
					    secret = db.Column(db.String, nullable=False)
 | 
				
			||||||
    name: Mapped[str] = mapped_column(db.String, nullable=False)
 | 
					    name = db.Column(db.String, nullable=False)
 | 
				
			||||||
 | 
					    created_at = db.Column(db.DateTime, default=datetime.now, nullable=False)
 | 
				
			||||||
 | 
					    last_used = db.Column(db.DateTime, nullable=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    user_id: Mapped[uuid.UUID] = mapped_column(
 | 
					    user_id = db.Column(
 | 
				
			||||||
            db.Uuid,
 | 
					            db.String(length=36),
 | 
				
			||||||
            db.ForeignKey(User.id), nullable=False)
 | 
					            db.ForeignKey(User.id), nullable=False)
 | 
				
			||||||
    # user: Mapped[User] = relationship(User, back_populates="totp")
 | 
					    user = db.relationship(User)
 | 
				
			||||||
    last_used: Mapped[Optional[datetime]] = mapped_column(db.DateTime, nullable=True, default=None)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def verify(self, token: str) -> bool:
 | 
					    def verify(self, token: str) -> bool:
 | 
				
			||||||
        totp = pyotp.TOTP(self.secret)
 | 
					        totp = pyotp.TOTP(self.secret)
 | 
				
			||||||
        return totp.verify(token)
 | 
					        return totp.verify(token)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class WebauthnCredential(BaseModel, ModelUpdatedMixin):  # pylint: disable=too-few-public-methods
 | 
					class WebauthnCredential(BaseModel):  # pylint: disable=too-few-public-methods
 | 
				
			||||||
    """Webauthn credential model"""
 | 
					    """Webauthn credential model"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
 | 
					    id = db.Column(db.Integer, primary_key=True)
 | 
				
			||||||
    user_id: Mapped[uuid.UUID] = mapped_column(db.Uuid, db.ForeignKey('user.id', ondelete='CASCADE'), nullable=False)
 | 
					    user_id = db.Column(db.String(length=36), db.ForeignKey('user.id', ondelete='CASCADE'), nullable=False)
 | 
				
			||||||
    user_handle: Mapped[str] = mapped_column(db.String(64), nullable=False)
 | 
					    user_handle = db.Column(db.String(64), nullable=False)
 | 
				
			||||||
    credential_data: Mapped[bytes] = mapped_column(db.LargeBinary, nullable=False)
 | 
					    credential_data = db.Column(db.LargeBinary, nullable=False)
 | 
				
			||||||
    name: Mapped[str] = mapped_column(db.String(250), nullable=False)
 | 
					    name = db.Column(db.String(250))
 | 
				
			||||||
    registered: Mapped[datetime] = mapped_column(db.DateTime, default=datetime.utcnow, nullable=False)
 | 
					    registered = db.Column(db.DateTime, default=datetime.utcnow)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # user = db.relationship('User', back_populates='webauthn_credentials')
 | 
					    user = db.relationship('User', back_populates='webauthn_credentials')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Group(BaseModel, ModelUpdatedMixin):
 | 
					class Group(BaseModel):
 | 
				
			||||||
    id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
 | 
					    id = db.Column(db.Integer, primary_key=True)
 | 
				
			||||||
    name: Mapped[str] = mapped_column(db.String(), nullable=False, unique=True)
 | 
					    name = db.Column(db.String(), nullable=False, unique=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@ from cryptography import x509
 | 
				
			||||||
from cryptography.hazmat.backends import default_backend
 | 
					from cryptography.hazmat.backends import default_backend
 | 
				
			||||||
from cryptography.hazmat.primitives import hashes
 | 
					from cryptography.hazmat.primitives import hashes
 | 
				
			||||||
from cryptography.hazmat.primitives import serialization
 | 
					from cryptography.hazmat.primitives import serialization
 | 
				
			||||||
from cryptography.hazmat.primitives.asymmetric import rsa, dh
 | 
					from cryptography.hazmat.primitives.asymmetric import rsa
 | 
				
			||||||
from cryptography.x509.oid import NameOID, ExtendedKeyUsageOID
 | 
					from cryptography.x509.oid import NameOID, ExtendedKeyUsageOID
 | 
				
			||||||
from cryptography.x509 import ObjectIdentifier
 | 
					from cryptography.x509 import ObjectIdentifier
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
| 
						 | 
					@ -109,9 +109,6 @@ class Pki(object):
 | 
				
			||||||
        _public_key = serialization.load_pem_public_key(
 | 
					        _public_key = serialization.load_pem_public_key(
 | 
				
			||||||
                publickey.encode(), backend=default_backend())
 | 
					                publickey.encode(), backend=default_backend())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if isinstance(_public_key, dh.DHPublicKey):
 | 
					 | 
				
			||||||
            raise AssertionError('key can not be a dsa key')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        ca_private_key, ca_cert = self._init_ca(service)
 | 
					        ca_private_key, ca_cert = self._init_ca(service)
 | 
				
			||||||
        ca_name = service.name
 | 
					        ca_name = service.name
 | 
				
			||||||
        username = str(user.username)
 | 
					        username = str(user.username)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<p>
 | 
						<p>
 | 
				
			||||||
	The application "{{ client.client_name }}" (id: {{ client.client_id }}) requested the following scopes: {{ requested_scope }}
 | 
						The application "{{ client.client_id }}" requested the following scopes: {{ requested_scope }}
 | 
				
			||||||
	</p>
 | 
						</p>
 | 
				
			||||||
	<p> Allow this app to access that data?</p>
 | 
						<p> Allow this app to access that data?</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,36 +4,47 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div>
 | 
					<ul class="nav nav-tabs" id="myTab" role="tablist">
 | 
				
			||||||
	<table class="table">
 | 
					  {% for service in services.values() if service.app_token %}
 | 
				
			||||||
		<thead>
 | 
						<li class="nav-item">
 | 
				
			||||||
			<tr>
 | 
							<a class="nav-link{{' active' if loop.first else ''}}" id="home-tab" data-toggle="tab" href="#{{ service.name }}" role="tab" aria-controls="home" aria-selected="true">{{ service.name }}</a>
 | 
				
			||||||
				<th>name</th>
 | 
						</li>
 | 
				
			||||||
				<th>scopes</th>
 | 
					  {% endfor %}
 | 
				
			||||||
				<th>last used</th>
 | 
					</ul>
 | 
				
			||||||
				<th>created at<th>
 | 
					
 | 
				
			||||||
				<th> <th>
 | 
					<div class="tab-content" id="myTabContent">
 | 
				
			||||||
			</tr>
 | 
						{% for service in services.values() if service.app_token %}
 | 
				
			||||||
		</thead>
 | 
					
 | 
				
			||||||
		<tbody>
 | 
						<div class="tab-pane fade{{ ' show active' if loop.first else '' }}" id="{{ service.name }}" role="tabpanel" aria-labelledby="{{ service.name }}-tab">
 | 
				
			||||||
			{% for app_token in current_user.app_tokens %}
 | 
							<table class="table">
 | 
				
			||||||
			<tr>
 | 
								<thead>
 | 
				
			||||||
				<td>{{ app_token.name }}</td>
 | 
									<tr>
 | 
				
			||||||
				<td>{{ app_token.scopes }}</td>
 | 
										<th>name</th>
 | 
				
			||||||
				<td>{{ app_token.last_used }}</td>
 | 
										<th>last used</th>
 | 
				
			||||||
				<td>{{ app_token.created_at }}</td>
 | 
										<th>created at<th>
 | 
				
			||||||
				<td>
 | 
										<th> <th>
 | 
				
			||||||
					{{ render_form(delete_form, action_url=url_for('frontend.app_token_delete', app_token_name=app_token.name)) }}
 | 
									</tr>
 | 
				
			||||||
		{#
 | 
								</thead>
 | 
				
			||||||
					<a title="{{ gettext('Revoke')}}" href="{{ url_for('.app_token_revoce', id=app_token.id) }}" onclick="client_cert.revoke_certificate(this.href, '{{ cert.serial_number_hex }}'); return false;"><i class="fas fa-ban"></i></a>
 | 
								<tbody>
 | 
				
			||||||
		#}
 | 
									{% for app_token in current_user.get_tokens_by_service(service) %}
 | 
				
			||||||
				</td>
 | 
									<tr>
 | 
				
			||||||
			</tr>
 | 
										<td>{{ app_token.name }}</td>
 | 
				
			||||||
			{% endfor %}
 | 
										<td>{{ app_token.last_used }}</td>
 | 
				
			||||||
 | 
										<td>{{ app_token.created_at }}</td>
 | 
				
			||||||
 | 
										<td>
 | 
				
			||||||
 | 
					            {{ render_form(delete_form, action_url=url_for('frontend.app_token_delete', service_name=service.name,app_token_name=app_token.name)) }}
 | 
				
			||||||
 | 
					            {#
 | 
				
			||||||
 | 
											<a title="{{ gettext('Revoke')}}" href="{{ url_for('.app_token_revoce', id=app_token.id) }}" onclick="client_cert.revoke_certificate(this.href, '{{ cert.serial_number_hex }}'); return false;"><i class="fas fa-ban"></i></a>
 | 
				
			||||||
 | 
					            #}
 | 
				
			||||||
 | 
										</td>
 | 
				
			||||||
 | 
									</tr>
 | 
				
			||||||
 | 
									{% endfor %}
 | 
				
			||||||
    </table>
 | 
					    </table>
 | 
				
			||||||
	<a class="btn btn-primary" href="{{ url_for('frontend.app_token_new') }}">
 | 
							<a class="btn btn-primary" href="{{ url_for('frontend.app_token_new', service_name=service.name) }}">
 | 
				
			||||||
		New Token
 | 
								New Token
 | 
				
			||||||
    </a>
 | 
					    </a>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
						{% endfor %}
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
{% extends 'frontend/base.html.j2' %}
 | 
					{% extends 'frontend/base.html.j2' %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block title %}{{ gettext('new app token') }}{% endblock %}
 | 
					{% block title %}{{ gettext('new app token for {service_name}').format(service_name=service.name) }}{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,12 @@
 | 
				
			||||||
{% extends 'frontend/base.html.j2' %}
 | 
					{% extends 'frontend/base.html.j2' %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block title %}{{ gettext('new app token') }}{% endblock %}
 | 
					{% block title %}{{ gettext('new app token for {service_name}').format(service_name=service.name) }}{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div>
 | 
					<div>
 | 
				
			||||||
	<p>
 | 
						<p>
 | 
				
			||||||
		Your new App Token for scopes: {app_token.scopes}:
 | 
							Your new App Token for {{ service.name }}:
 | 
				
			||||||
	</p>
 | 
						</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<p>
 | 
						<p>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,61 +3,44 @@ from flask_babel import Babel
 | 
				
			||||||
from flask_login import current_user
 | 
					from flask_login import current_user
 | 
				
			||||||
from typing import Optional
 | 
					from typing import Optional
 | 
				
			||||||
from lenticular_cloud.model import db, User
 | 
					from lenticular_cloud.model import db, User
 | 
				
			||||||
from importlib.metadata import version
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
LANGUAGES = {
 | 
					LANGUAGES = {
 | 
				
			||||||
    'en': 'English',
 | 
					    'en': 'English',
 | 
				
			||||||
    'de': 'Deutsch'
 | 
					    'de': 'Deutsch'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					babel = Babel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@babel.localeselector
 | 
				
			||||||
def get_locale() -> str:
 | 
					def get_locale() -> str:
 | 
				
			||||||
    # if a user is logged in, use the locale from the user settings
 | 
					    # if a user is logged in, use the locale from the user settings
 | 
				
			||||||
    #user = current_user # type: Optional[User]
 | 
					    user = current_user # type: Optional[User]
 | 
				
			||||||
    return 'de'
 | 
					    return 'de'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # prefer lang argument
 | 
					    # prefer lang argument
 | 
				
			||||||
    # if 'lang' in request.args:
 | 
					    if 'lang' in request.args:
 | 
				
			||||||
    #     lang = request.args['lang'] # type: str
 | 
					        lang = request.args['lang'] # type: str
 | 
				
			||||||
    #     if lang in LANGUAGES:
 | 
					        if lang in LANGUAGES:
 | 
				
			||||||
    #         if not isinstance(user, User):
 | 
					            if not isinstance(user, User):
 | 
				
			||||||
    #                 return lang
 | 
					                    return lang
 | 
				
			||||||
    #         user.locale = lang
 | 
					            user.locale = lang
 | 
				
			||||||
    #         db.session.commit()
 | 
					            db.session.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # if isinstance(user, User):
 | 
					    if isinstance(user, User):
 | 
				
			||||||
    #     return user.locale
 | 
					        return user.locale
 | 
				
			||||||
    # # otherwise try to guess the language from the user accept
 | 
					    # otherwise try to guess the language from the user accept
 | 
				
			||||||
    # # header the browser transmits.  We support de/fr/en in this
 | 
					    # header the browser transmits.  We support de/fr/en in this
 | 
				
			||||||
    # # example.  The best match wins.
 | 
					    # example.  The best match wins.
 | 
				
			||||||
    # return request.accept_languages.best_match(['de'])
 | 
					    return request.accept_languages.best_match(['de'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@babel.timezoneselector
 | 
				
			||||||
def get_timezone() -> Optional[str]:
 | 
					def get_timezone() -> Optional[str]:
 | 
				
			||||||
#       user = getattr(g, 'user', None)
 | 
					#       user = getattr(g, 'user', None)
 | 
				
			||||||
#       if user is not None:
 | 
					#       if user is not None:
 | 
				
			||||||
#           return user.timezone
 | 
					#           return user.timezone
 | 
				
			||||||
    return None
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
flask_babel_version = version('flask_babel')
 | 
					 | 
				
			||||||
kwargs = {}
 | 
					 | 
				
			||||||
if flask_babel_version >= "3.0.0":
 | 
					 | 
				
			||||||
    kwargs = {
 | 
					 | 
				
			||||||
        'locale_selector': get_locale,
 | 
					 | 
				
			||||||
        #'timezone_selector': get_timezone,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
babel = Babel(**kwargs)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if flask_babel_version < "3.0.0":
 | 
					 | 
				
			||||||
    @babel.localeselector
 | 
					 | 
				
			||||||
    def _get_locale() -> str:
 | 
					 | 
				
			||||||
        return get_locale()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @babel.timezoneselector
 | 
					 | 
				
			||||||
    def _get_timezone() -> Optional[str]:
 | 
					 | 
				
			||||||
        return get_timezone()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def init_babel(app: Flask) -> None:
 | 
					def init_babel(app: Flask) -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    babel.init_app(app)
 | 
					    babel.init_app(app)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,12 +6,10 @@ from flask.typing import ResponseReturnValue
 | 
				
			||||||
from flask_login import current_user, logout_user
 | 
					from flask_login import current_user, logout_user
 | 
				
			||||||
from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
 | 
					from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
 | 
				
			||||||
from authlib.integrations.base_client.errors import InvalidTokenError
 | 
					from authlib.integrations.base_client.errors import InvalidTokenError
 | 
				
			||||||
from ory_hydra_client.api.o_auth_2 import list_o_auth_2_clients, get_o_auth_2_client, set_o_auth_2_client, create_o_auth_2_client 
 | 
					from ory_hydra_client.api.admin import list_o_auth_2_clients, get_o_auth_2_client, update_o_auth_2_client, create_o_auth_2_client 
 | 
				
			||||||
from ory_hydra_client.models import OAuth20Client, GenericError
 | 
					from ory_hydra_client.models import OAuth2Client, GenericError
 | 
				
			||||||
from typing import Optional, List
 | 
					from typing import Optional
 | 
				
			||||||
from collections.abc import Iterable
 | 
					from collections.abc import Iterable
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..model import db, User
 | 
					from ..model import db, User
 | 
				
			||||||
| 
						 | 
					@ -46,7 +44,7 @@ async def index() -> ResponseReturnValue:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@admin_views.route('/user', methods=['GET'])
 | 
					@admin_views.route('/user', methods=['GET'])
 | 
				
			||||||
async def users() -> ResponseReturnValue:
 | 
					async def users():
 | 
				
			||||||
    users = User.query.all() # type: Iterable[User]
 | 
					    users = User.query.all() # type: Iterable[User]
 | 
				
			||||||
    return render_template('admin/users.html.j2', users=users)
 | 
					    return render_template('admin/users.html.j2', users=users)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,11 +77,7 @@ def registration_accept(registration_id) -> ResponseReturnValue:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@admin_views.route('/clients')
 | 
					@admin_views.route('/clients')
 | 
				
			||||||
async def clients() -> ResponseReturnValue:
 | 
					async def clients() -> ResponseReturnValue:
 | 
				
			||||||
    response = await list_o_auth_2_clients.asyncio_detailed(_client=hydra_service.hydra_client)
 | 
					    clients = await list_o_auth_2_clients.asyncio(_client=hydra_service.hydra_client)
 | 
				
			||||||
    clients = response.parsed
 | 
					 | 
				
			||||||
    if clients is None:
 | 
					 | 
				
			||||||
        logger.error(f"could not fetch client list response {response}")
 | 
					 | 
				
			||||||
        return 'internal error', 500
 | 
					 | 
				
			||||||
    return render_template('admin/clients.html.j2', clients=clients)
 | 
					    return render_template('admin/clients.html.j2', clients=clients)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@admin_views.route('/client/<client_id>', methods=['GET', 'POST'])
 | 
					@admin_views.route('/client/<client_id>', methods=['GET', 'POST'])
 | 
				
			||||||
| 
						 | 
					@ -98,7 +92,7 @@ async def client(client_id: str) -> ResponseReturnValue:
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        form.populate_obj(client)
 | 
					        form.populate_obj(client)
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
        client = await set_o_auth_2_client.asyncio(id=client_id ,json_body=client, _client=hydra_service.hydra_client)
 | 
					        client = await update_o_auth_2_client.asyncio(id=client_id ,json_body=client, _client=hydra_service.hydra_client)
 | 
				
			||||||
        if client is None or isinstance(client, GenericError):
 | 
					        if client is None or isinstance(client, GenericError):
 | 
				
			||||||
            logger.error(f"oauth2 client update failed: '{client_id}'")
 | 
					            logger.error(f"oauth2 client update failed: '{client_id}'")
 | 
				
			||||||
            return 'client update failed', 500
 | 
					            return 'client update failed', 500
 | 
				
			||||||
| 
						 | 
					@ -111,7 +105,7 @@ async def client(client_id: str) -> ResponseReturnValue:
 | 
				
			||||||
@admin_views.route('/client_new', methods=['GET','POST'])
 | 
					@admin_views.route('/client_new', methods=['GET','POST'])
 | 
				
			||||||
async def client_new() -> ResponseReturnValue:
 | 
					async def client_new() -> ResponseReturnValue:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    client = OAuth20Client()
 | 
					    client = OAuth2Client()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    form = OAuth2ClientForm()
 | 
					    form = OAuth2ClientForm()
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
| 
						 | 
					@ -119,7 +113,7 @@ async def client_new() -> ResponseReturnValue:
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
        resp_client = await create_o_auth_2_client.asyncio(json_body=client, _client=hydra_service.hydra_client)
 | 
					        resp_client = await create_o_auth_2_client.asyncio(json_body=client, _client=hydra_service.hydra_client)
 | 
				
			||||||
        if resp_client is None:
 | 
					        if resp_client is None:
 | 
				
			||||||
            logger.error(f"oauth2 client created failed: '{client.client_id}'")
 | 
					            logger.error(f"oauth2 client update failed: '{client.client_id}'")
 | 
				
			||||||
            return 'internal error', 500
 | 
					            return 'internal error', 500
 | 
				
			||||||
        return redirect(url_for('.client', client_id=client.client_id))
 | 
					        return redirect(url_for('.client', client_id=client.client_id))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@ import secrets
 | 
				
			||||||
from ..model import db, User
 | 
					from ..model import db, User
 | 
				
			||||||
from ..hydra import hydra_service
 | 
					from ..hydra import hydra_service
 | 
				
			||||||
from ..lenticular_services import lenticular_services
 | 
					from ..lenticular_services import lenticular_services
 | 
				
			||||||
from ory_hydra_client.api.o_auth_2 import introspect_o_auth_2_token
 | 
					from ory_hydra_client.api.admin import introspect_o_auth_2_token
 | 
				
			||||||
from ory_hydra_client.models import GenericError
 | 
					from ory_hydra_client.models import GenericError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,36 +58,36 @@ def introspect() -> ResponseReturnValue:
 | 
				
			||||||
    return jsonify(token_info)
 | 
					    return jsonify(token_info)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# @api_views.route('/login/<service_name>', methods=['POST'])
 | 
					@api_views.route('/login/<service_name>', methods=['POST'])
 | 
				
			||||||
# def email_login(service_name: str) -> ResponseReturnValue:
 | 
					def email_login(service_name: str) -> ResponseReturnValue:
 | 
				
			||||||
#     if service_name not in lenticular_services:
 | 
					    if service_name not in lenticular_services:
 | 
				
			||||||
#         return '', 404
 | 
					        return '', 404
 | 
				
			||||||
#     service = lenticular_services[service_name]
 | 
					    service = lenticular_services[service_name]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     if not request.is_json:
 | 
					    if not request.is_json:
 | 
				
			||||||
#         return jsonify({}), 400
 | 
					        return jsonify({}), 400
 | 
				
			||||||
#     req_payload = request.get_json() # type: Any
 | 
					    req_payload = request.get_json() # type: Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     if not isinstance(req_payload, dict):
 | 
					    if not isinstance(req_payload, dict):
 | 
				
			||||||
#         return 'bad request', 400
 | 
					        return 'bad request', 400
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     password = req_payload["password"]
 | 
					    password = req_payload["password"]
 | 
				
			||||||
#     username = req_payload["username"]
 | 
					    username = req_payload["username"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     if '@' in username:
 | 
					    if '@' in username:
 | 
				
			||||||
#         username = username.split('@')[0]
 | 
					        username = username.split('@')[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     user = User.query.filter_by(username=username.lower()).first() # type: Optional[User]
 | 
					    user = User.query.filter_by(username=username.lower()).first() # type: Optional[User]
 | 
				
			||||||
#     if user is None:
 | 
					    if user is None:
 | 
				
			||||||
#         logger.warning(f'login with invalid username')
 | 
					        logger.warning(f'login with invalid username')
 | 
				
			||||||
#         return jsonify({}), 403
 | 
					        return jsonify({}), 403
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     for app_token in user.get_token_by_name(service):
 | 
					    for app_token in user.get_tokens_by_service(service):
 | 
				
			||||||
#         if secrets.compare_digest(password, app_token.token):
 | 
					        if secrets.compare_digest(password, app_token.token):
 | 
				
			||||||
#             app_token.last_used = datetime.now()
 | 
					            app_token.last_used = datetime.now()
 | 
				
			||||||
#             db.session.commit()
 | 
					            db.session.commit()
 | 
				
			||||||
#             return jsonify({'username': user.username}), 200
 | 
					            return jsonify({'username': user.username}), 200
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#     logger.warning(f'login with invalid password for {username}')
 | 
					    logger.warning(f'login with invalid password for {username}')
 | 
				
			||||||
#     return jsonify({}), 403
 | 
					    return jsonify({}), 403
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,11 +17,9 @@ import crypt
 | 
				
			||||||
from datetime import datetime
 | 
					from datetime import datetime
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
import json
 | 
					import json
 | 
				
			||||||
from ory_hydra_client.api.o_auth_2 import get_o_auth_2_consent_request, accept_o_auth_2_consent_request, accept_o_auth_2_login_request, get_o_auth_2_login_request, accept_o_auth_2_login_request, accept_o_auth_2_logout_request, get_o_auth_2_login_request
 | 
					from ory_hydra_client.api.admin import get_consent_request, accept_consent_request, accept_login_request, get_login_request, accept_login_request, accept_logout_request, get_login_request
 | 
				
			||||||
from ory_hydra_client import models as ory_hydra_m
 | 
					from ory_hydra_client.models import AcceptLoginRequest, AcceptConsentRequest, ConsentRequestSession, GenericError, ConsentRequestSessionAccessToken, ConsentRequestSessionIdToken
 | 
				
			||||||
from ory_hydra_client.models import TheRequestPayloadUsedToAcceptALoginOrConsentRequest, TheRequestPayloadUsedToAcceptAConsentRequest, GenericError
 | 
					 | 
				
			||||||
from typing import Optional
 | 
					from typing import Optional
 | 
				
			||||||
from uuid import uuid4
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..model import db, User, SecurityUser
 | 
					from ..model import db, User, SecurityUser
 | 
				
			||||||
from ..form.auth import ConsentForm, LoginForm, RegistrationForm
 | 
					from ..form.auth import ConsentForm, LoginForm, RegistrationForm
 | 
				
			||||||
| 
						 | 
					@ -45,11 +43,19 @@ async def consent() -> ResponseReturnValue:
 | 
				
			||||||
    remember_for = 60*60*24*30  # remember for 30 days
 | 
					    remember_for = 60*60*24*30  # remember for 30 days
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #try:
 | 
					    #try:
 | 
				
			||||||
    consent_request = await get_o_auth_2_consent_request.asyncio(consent_challenge=request.args['consent_challenge'],_client=hydra_service.hydra_client)
 | 
					    consent_request = await get_consent_request.asyncio(consent_challenge=request.args['consent_challenge'],_client=hydra_service.hydra_client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if consent_request is None or isinstance( consent_request, ory_hydra_m.OAuth20RedirectBrowserTo):
 | 
					    if consent_request is None or isinstance( consent_request, GenericError):
 | 
				
			||||||
       return redirect(url_for('frontend.index'))
 | 
					       return redirect(url_for('frontend.index'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#   except ory_hydra_client.exceptions.ApiValueError:
 | 
				
			||||||
 | 
					#       logger.info('ory exception - could not fetch user data ApiValueError')
 | 
				
			||||||
 | 
					#       return redirect(url_for('frontend.index'))
 | 
				
			||||||
 | 
					#   except ory_hydra_client.exceptions.ApiException:
 | 
				
			||||||
 | 
					#       logger.exception('ory exception - could not fetch user data')
 | 
				
			||||||
 | 
					#       return redirect(url_for('frontend.index'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    requested_scope = consent_request.requested_scope
 | 
					    requested_scope = consent_request.requested_scope
 | 
				
			||||||
    requested_audiences = consent_request.requested_access_token_audience
 | 
					    requested_audiences = consent_request.requested_access_token_audience
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,7 +63,7 @@ async def consent() -> ResponseReturnValue:
 | 
				
			||||||
        user = User.query.get(consent_request.subject) # type: Optional[User]
 | 
					        user = User.query.get(consent_request.subject) # type: Optional[User]
 | 
				
			||||||
        if user is None:
 | 
					        if user is None:
 | 
				
			||||||
            return 'internal error', 500
 | 
					            return 'internal error', 500
 | 
				
			||||||
        access_token = {
 | 
					        token_data = {
 | 
				
			||||||
            'name': str(user.username),
 | 
					            'name': str(user.username),
 | 
				
			||||||
            'preferred_username': str(user.username),
 | 
					            'preferred_username': str(user.username),
 | 
				
			||||||
            'username': str(user.username),
 | 
					            'username': str(user.username),
 | 
				
			||||||
| 
						 | 
					@ -67,20 +73,22 @@ async def consent() -> ResponseReturnValue:
 | 
				
			||||||
            #'family_name': '-',
 | 
					            #'family_name': '-',
 | 
				
			||||||
            'groups': [group.name for group in user.groups]
 | 
					            'groups': [group.name for group in user.groups]
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        id_token = {}
 | 
					        id_token_data = {}
 | 
				
			||||||
        if isinstance(requested_scope, list) and 'openid' in requested_scope:
 | 
					        if isinstance(requested_scope, list) and 'openid' in requested_scope:
 | 
				
			||||||
            id_token = access_token
 | 
					            id_token_data = token_data
 | 
				
			||||||
        body = TheRequestPayloadUsedToAcceptAConsentRequest(
 | 
					        access_token=ConsentRequestSessionAccessToken.from_dict(token_data)
 | 
				
			||||||
 | 
					        id_token=ConsentRequestSessionIdToken.from_dict(id_token_data)
 | 
				
			||||||
 | 
					        body = AcceptConsentRequest(
 | 
				
			||||||
                grant_scope= requested_scope,
 | 
					                grant_scope= requested_scope,
 | 
				
			||||||
                grant_access_token_audience= requested_audiences,
 | 
					                grant_access_token_audience= requested_audiences,
 | 
				
			||||||
                remember= form.data['remember'],
 | 
					                remember= form.data['remember'],
 | 
				
			||||||
                remember_for= remember_for,
 | 
					                remember_for= remember_for,
 | 
				
			||||||
                session= ory_hydra_m.PassSessionDataToAConsentRequest(
 | 
					                session= ConsentRequestSession(
 | 
				
			||||||
                    access_token= access_token,
 | 
					                    access_token= access_token,
 | 
				
			||||||
                    id_token= id_token
 | 
					                    id_token= id_token
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        resp = await accept_o_auth_2_consent_request.asyncio(_client=hydra_service.hydra_client,
 | 
					        resp = await accept_consent_request.asyncio(_client=hydra_service.hydra_client,
 | 
				
			||||||
            json_body=body,
 | 
					            json_body=body,
 | 
				
			||||||
            consent_challenge=consent_request.challenge)
 | 
					            consent_challenge=consent_request.challenge)
 | 
				
			||||||
        if resp is None or isinstance( resp, GenericError):
 | 
					        if resp is None or isinstance( resp, GenericError):
 | 
				
			||||||
| 
						 | 
					@ -99,15 +107,15 @@ async def login() -> ResponseReturnValue:
 | 
				
			||||||
    login_challenge = request.args.get('login_challenge')
 | 
					    login_challenge = request.args.get('login_challenge')
 | 
				
			||||||
    if login_challenge is None:
 | 
					    if login_challenge is None:
 | 
				
			||||||
        return 'login_challenge missing', 400
 | 
					        return 'login_challenge missing', 400
 | 
				
			||||||
    login_request = await get_o_auth_2_login_request.asyncio(_client=hydra_service.hydra_client, login_challenge=login_challenge)
 | 
					    login_request = await get_login_request.asyncio(_client=hydra_service.hydra_client, login_challenge=login_challenge)
 | 
				
			||||||
    if login_request is None or isinstance( login_request, ory_hydra_m.OAuth20RedirectBrowserTo):
 | 
					    if login_request is None or isinstance( login_request, GenericError):
 | 
				
			||||||
        logger.exception("could not fetch login request")
 | 
					        logger.exception("could not fetch login request")
 | 
				
			||||||
        return redirect(url_for('frontend.index'))
 | 
					        return redirect(url_for('frontend.index'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if login_request.skip:
 | 
					    if login_request.skip:
 | 
				
			||||||
        resp = await accept_o_auth_2_login_request.asyncio(_client=hydra_service.hydra_client,
 | 
					        resp = await accept_login_request.asyncio(_client=hydra_service.hydra_client,
 | 
				
			||||||
            login_challenge=login_challenge,
 | 
					            login_challenge=login_challenge,
 | 
				
			||||||
            json_body=ory_hydra_m.HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest(subject=login_request.subject))
 | 
					            json_body=AcceptLoginRequest(subject=login_request.subject))
 | 
				
			||||||
        if resp is None or isinstance( resp, GenericError):
 | 
					        if resp is None or isinstance( resp, GenericError):
 | 
				
			||||||
            return 'internal error, could not forward request', 503
 | 
					            return 'internal error, could not forward request', 503
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,14 +138,14 @@ async def login_auth() -> ResponseReturnValue:
 | 
				
			||||||
    login_challenge = request.args.get('login_challenge')
 | 
					    login_challenge = request.args.get('login_challenge')
 | 
				
			||||||
    if login_challenge is None:
 | 
					    if login_challenge is None:
 | 
				
			||||||
        return 'missing login_challenge, bad request', 400
 | 
					        return 'missing login_challenge, bad request', 400
 | 
				
			||||||
    login_request = await get_o_auth_2_login_request.asyncio(_client=hydra_service.hydra_client, login_challenge=login_challenge)
 | 
					    login_request = await get_login_request.asyncio(_client=hydra_service.hydra_client, login_challenge=login_challenge)
 | 
				
			||||||
    if login_request is None:
 | 
					    if login_request is None:
 | 
				
			||||||
        return redirect(url_for('frontend.index'))
 | 
					        return redirect(url_for('frontend.index'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if 'username' not in session:
 | 
					    if 'username' not in session:
 | 
				
			||||||
        return redirect(url_for('auth.login'))
 | 
					        return redirect(url_for('auth.login'))
 | 
				
			||||||
    auth_forms = {}
 | 
					    auth_forms = {}
 | 
				
			||||||
    user = User.query.filter_by(username=session['username']).first_or_404()
 | 
					    user = User.query.filter_by(username=session['username']).first() # Optional[User]
 | 
				
			||||||
    for auth_provider in AUTH_PROVIDER_LIST:
 | 
					    for auth_provider in AUTH_PROVIDER_LIST:
 | 
				
			||||||
        form = auth_provider.get_form()
 | 
					        form = auth_provider.get_form()
 | 
				
			||||||
        if auth_provider.get_name() not in session['auth_providers'] and\
 | 
					        if auth_provider.get_name() not in session['auth_providers'] and\
 | 
				
			||||||
| 
						 | 
					@ -155,11 +163,11 @@ async def login_auth() -> ResponseReturnValue:
 | 
				
			||||||
#           db.session.add(db_user)
 | 
					#           db.session.add(db_user)
 | 
				
			||||||
#           db.session.commit()
 | 
					#           db.session.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        subject = str(user.id)
 | 
					        subject = user.id
 | 
				
			||||||
        user.last_login = datetime.now()
 | 
					        user.last_login = datetime.now()
 | 
				
			||||||
        db.session.commit()
 | 
					        db.session.commit()
 | 
				
			||||||
        resp = await accept_o_auth_2_login_request.asyncio(_client=hydra_service.hydra_client,
 | 
					        resp = await accept_login_request.asyncio(_client=hydra_service.hydra_client,
 | 
				
			||||||
            login_challenge=login_challenge, json_body=ory_hydra_m.HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest(
 | 
					            login_challenge=login_challenge, json_body=AcceptLoginRequest(
 | 
				
			||||||
                subject=subject,
 | 
					                subject=subject,
 | 
				
			||||||
                remember=remember_me,
 | 
					                remember=remember_me,
 | 
				
			||||||
            ))
 | 
					            ))
 | 
				
			||||||
| 
						 | 
					@ -171,9 +179,8 @@ async def login_auth() -> ResponseReturnValue:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@auth_views.route('/webauthn/pkcro', methods=['POST'])
 | 
					@auth_views.route('/webauthn/pkcro', methods=['POST'])
 | 
				
			||||||
def webauthn_pkcro_route() -> ResponseReturnValue:
 | 
					def webauthn_pkcro_route():
 | 
				
			||||||
    """login webauthn pkcro route"""
 | 
					    """login webauthn pkcro route"""
 | 
				
			||||||
    return '', 404
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    user = User.query.filter(User.id == session.get('webauthn_login_user_id')).one() #type: User
 | 
					    user = User.query.filter(User.id == session.get('webauthn_login_user_id')).one() #type: User
 | 
				
			||||||
    form = ButtonForm()
 | 
					    form = ButtonForm()
 | 
				
			||||||
| 
						 | 
					@ -191,7 +198,7 @@ async def logout() -> ResponseReturnValue:
 | 
				
			||||||
    if logout_challenge is None:
 | 
					    if logout_challenge is None:
 | 
				
			||||||
        return 'invalid request, logout_challenge not set', 400
 | 
					        return 'invalid request, logout_challenge not set', 400
 | 
				
			||||||
    # TODO confirm
 | 
					    # TODO confirm
 | 
				
			||||||
    resp = await accept_o_auth_2_logout_request.asyncio(_client=hydra_service.hydra_client, logout_challenge=logout_challenge)
 | 
					    resp = await accept_logout_request.asyncio(_client=hydra_service.hydra_client, logout_challenge=logout_challenge)
 | 
				
			||||||
    if resp is None or isinstance( resp, GenericError):
 | 
					    if resp is None or isinstance( resp, GenericError):
 | 
				
			||||||
        return 'internal error, could not forward request', 503
 | 
					        return 'internal error, could not forward request', 503
 | 
				
			||||||
    return redirect(resp.redirect_to)
 | 
					    return redirect(resp.redirect_to)
 | 
				
			||||||
| 
						 | 
					@ -215,7 +222,6 @@ def sign_up_submit():
 | 
				
			||||||
    form = RegistrationForm()
 | 
					    form = RegistrationForm()
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        user = User()
 | 
					        user = User()
 | 
				
			||||||
        user.id = uuid4()
 | 
					 | 
				
			||||||
        user.username = form.data['username']
 | 
					        user.username = form.data['username']
 | 
				
			||||||
        user.password_hashed = crypt.crypt(form.data['password'])
 | 
					        user.password_hashed = crypt.crypt(form.data['password'])
 | 
				
			||||||
        user.alternative_email = form.data['alternative_email']
 | 
					        user.alternative_email = form.data['alternative_email']
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
from authlib.integrations.base_client.errors import MissingTokenError, InvalidTokenError
 | 
					from authlib.integrations.base_client.errors import MissingTokenError, InvalidTokenError
 | 
				
			||||||
from base64 import b64encode, b64decode
 | 
					from base64 import b64encode, b64decode
 | 
				
			||||||
from fido2 import cbor
 | 
					from fido2 import cbor
 | 
				
			||||||
from fido2.webauthn import CollectedClientData, AttestationObject, AttestedCredentialData, AuthenticatorData, PublicKeyCredentialUserEntity
 | 
					from fido2.webauthn import AttestationObject, AttestedCredentialData, AuthenticatorData
 | 
				
			||||||
from flask import Blueprint, Response, redirect, request
 | 
					from flask import Blueprint, Response, redirect, request
 | 
				
			||||||
from flask import current_app
 | 
					from flask import current_app
 | 
				
			||||||
from flask import jsonify, session, flash
 | 
					from flask import jsonify, session, flash
 | 
				
			||||||
| 
						 | 
					@ -15,13 +15,13 @@ from datetime import timedelta
 | 
				
			||||||
from base64 import b64decode
 | 
					from base64 import b64decode
 | 
				
			||||||
from flask.typing import ResponseReturnValue 
 | 
					from flask.typing import ResponseReturnValue 
 | 
				
			||||||
from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
 | 
					from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
 | 
				
			||||||
from ory_hydra_client.api.o_auth_2 import list_o_auth_2_consent_sessions, revoke_o_auth_2_consent_sessions
 | 
					from ory_hydra_client.api.admin import list_subject_consent_sessions, revoke_consent_sessions
 | 
				
			||||||
from ory_hydra_client.models import GenericError
 | 
					from ory_hydra_client.models import GenericError
 | 
				
			||||||
from urllib.parse import urlencode, parse_qs
 | 
					from urllib.parse import urlencode, parse_qs
 | 
				
			||||||
from random import SystemRandom
 | 
					from random import SystemRandom
 | 
				
			||||||
import string
 | 
					import string
 | 
				
			||||||
from collections.abc import Iterable
 | 
					from collections.abc import Iterable
 | 
				
			||||||
from typing import Optional, Mapping, Iterator, List, Any
 | 
					from typing import Optional
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..model import db, User, SecurityUser, Totp, AppToken, WebauthnCredential
 | 
					from ..model import db, User, SecurityUser, Totp, AppToken, WebauthnCredential
 | 
				
			||||||
from ..form.frontend import ClientCertForm, TOTPForm, \
 | 
					from ..form.frontend import ClientCertForm, TOTPForm, \
 | 
				
			||||||
| 
						 | 
					@ -38,16 +38,11 @@ from ..lenticular_services import lenticular_services
 | 
				
			||||||
frontend_views = Blueprint('frontend', __name__, url_prefix='')
 | 
					frontend_views = Blueprint('frontend', __name__, url_prefix='')
 | 
				
			||||||
logger = logging.getLogger(__name__)
 | 
					logger = logging.getLogger(__name__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_current_user() -> User:
 | 
					 | 
				
			||||||
    user_any: Any = current_user
 | 
					 | 
				
			||||||
    user: User = user_any
 | 
					 | 
				
			||||||
    return user
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
def before_request() -> Optional[ResponseReturnValue]:
 | 
					def before_request() -> Optional[ResponseReturnValue]:
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        resp = oauth2.custom.get('/userinfo')
 | 
					        resp = oauth2.custom.get('/userinfo')
 | 
				
			||||||
        if not get_current_user().is_authenticated or resp.status_code != 200:
 | 
					        if not current_user.is_authenticated or resp.status_code != 200:
 | 
				
			||||||
            logger.info('user not logged in redirect')
 | 
					            logger.info('user not logged in redirect')
 | 
				
			||||||
            return redirect_login()
 | 
					            return redirect_login()
 | 
				
			||||||
    except MissingTokenError:
 | 
					    except MissingTokenError:
 | 
				
			||||||
| 
						 | 
					@ -84,7 +79,7 @@ def client_cert() -> ResponseReturnValue:
 | 
				
			||||||
    client_certs = {}
 | 
					    client_certs = {}
 | 
				
			||||||
    for service in lenticular_services.values():
 | 
					    for service in lenticular_services.values():
 | 
				
			||||||
        client_certs[str(service.name)] = \
 | 
					        client_certs[str(service.name)] = \
 | 
				
			||||||
                pki.get_client_certs(get_current_user(), service)
 | 
					                pki.get_client_certs(current_user, service)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render_template(
 | 
					    return render_template(
 | 
				
			||||||
            'frontend/client_cert.html.j2',
 | 
					            'frontend/client_cert.html.j2',
 | 
				
			||||||
| 
						 | 
					@ -96,7 +91,7 @@ def client_cert() -> ResponseReturnValue:
 | 
				
			||||||
def get_client_cert(service_name, serial_number) -> ResponseReturnValue:
 | 
					def get_client_cert(service_name, serial_number) -> ResponseReturnValue:
 | 
				
			||||||
    service = lenticular_services[service_name]
 | 
					    service = lenticular_services[service_name]
 | 
				
			||||||
    cert = pki.get_client_cert(
 | 
					    cert = pki.get_client_cert(
 | 
				
			||||||
            get_current_user(), service, serial_number)
 | 
					            current_user, service, serial_number)
 | 
				
			||||||
    return jsonify({
 | 
					    return jsonify({
 | 
				
			||||||
        'data': {
 | 
					        'data': {
 | 
				
			||||||
            'pem': cert.pem()}
 | 
					            'pem': cert.pem()}
 | 
				
			||||||
| 
						 | 
					@ -108,7 +103,7 @@ def get_client_cert(service_name, serial_number) -> ResponseReturnValue:
 | 
				
			||||||
def revoke_client_cert(service_name, serial_number) -> ResponseReturnValue:
 | 
					def revoke_client_cert(service_name, serial_number) -> ResponseReturnValue:
 | 
				
			||||||
    service = lenticular_services[service_name]
 | 
					    service = lenticular_services[service_name]
 | 
				
			||||||
    cert = pki.get_client_cert(
 | 
					    cert = pki.get_client_cert(
 | 
				
			||||||
            get_current_user(), service, serial_number)
 | 
					            current_user, service, serial_number)
 | 
				
			||||||
    pki.revoke_certificate(cert)
 | 
					    pki.revoke_certificate(cert)
 | 
				
			||||||
    return jsonify({})
 | 
					    return jsonify({})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -124,7 +119,7 @@ def client_cert_new(service_name) -> ResponseReturnValue:
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        valid_time = int(form.data['valid_time']) * timedelta(1, 0, 0)
 | 
					        valid_time = int(form.data['valid_time']) * timedelta(1, 0, 0)
 | 
				
			||||||
        cert = pki.signing_publickey(
 | 
					        cert = pki.signing_publickey(
 | 
				
			||||||
                get_current_user(),
 | 
					                current_user,
 | 
				
			||||||
                service,
 | 
					                service,
 | 
				
			||||||
                form.data['publickey'],
 | 
					                form.data['publickey'],
 | 
				
			||||||
                valid_time=valid_time)
 | 
					                valid_time=valid_time)
 | 
				
			||||||
| 
						 | 
					@ -153,33 +148,39 @@ def app_token() -> ResponseReturnValue:
 | 
				
			||||||
                           delete_form=delete_form,
 | 
					                           delete_form=delete_form,
 | 
				
			||||||
                           services=lenticular_services)
 | 
					                           services=lenticular_services)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@frontend_views.route('/app_token/new', methods=['GET','POST'])
 | 
					@frontend_views.route('/app_token/<service_name>/new', methods=['GET','POST'])
 | 
				
			||||||
def app_token_new() -> ResponseReturnValue:
 | 
					def app_token_new(service_name: str) -> ResponseReturnValue:
 | 
				
			||||||
 | 
					    if service_name not in lenticular_services:
 | 
				
			||||||
 | 
					        return '', 404
 | 
				
			||||||
 | 
					    service = lenticular_services[service_name]
 | 
				
			||||||
    form = AppTokenForm()
 | 
					    form = AppTokenForm()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        user_any = get_current_user() # type: Any
 | 
					        app_token = AppToken.new(service)
 | 
				
			||||||
        user = user_any # type: User
 | 
					 | 
				
			||||||
        app_token = AppToken.new(user, name="",scopes="")
 | 
					 | 
				
			||||||
        form.populate_obj(app_token)
 | 
					        form.populate_obj(app_token)
 | 
				
			||||||
        # check for duplicate names
 | 
					        # check for duplicate names
 | 
				
			||||||
        for user_app_token in user.app_tokens:
 | 
					        for user_app_token in current_user.app_tokens:
 | 
				
			||||||
            if user_app_token.name == app_token.name:
 | 
					            if user_app_token.name == app_token.name:
 | 
				
			||||||
                return 'name already exist', 400
 | 
					                return 'name already exist', 400
 | 
				
			||||||
        user.app_tokens.append(app_token)
 | 
					        current_user.app_tokens.append(app_token)
 | 
				
			||||||
        db.session.commit()
 | 
					        db.session.commit()
 | 
				
			||||||
        return render_template('frontend/app_token_new_show.html.j2', app_token=app_token)
 | 
					        return render_template('frontend/app_token_new_show.html.j2', service=service, app_token=app_token)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render_template('frontend/app_token_new.html.j2',
 | 
					    return render_template('frontend/app_token_new.html.j2',
 | 
				
			||||||
                           form=form)
 | 
					                           form=form,
 | 
				
			||||||
 | 
					                           service=service)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@frontend_views.route('/app_token/<app_token_name>', methods=["POST"])
 | 
					@frontend_views.route('/app_token/<service_name>/<app_token_name>', methods=["POST"])
 | 
				
			||||||
def app_token_delete(app_token_name: str) -> ResponseReturnValue:
 | 
					def app_token_delete(service_name: str, app_token_name: str) -> ResponseReturnValue:
 | 
				
			||||||
    form = AppTokenDeleteForm()
 | 
					    form = AppTokenDeleteForm()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if service_name not in lenticular_services:
 | 
				
			||||||
 | 
					        return '', 404
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    service = lenticular_services[service_name]
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        app_token = get_current_user().get_token_by_name(app_token_name)
 | 
					        app_token = current_user.get_token(service, app_token_name)
 | 
				
			||||||
        if app_token is None:
 | 
					        if app_token is None:
 | 
				
			||||||
            return 'not found', 404
 | 
					            return 'not found', 404
 | 
				
			||||||
        db.session.delete(app_token)
 | 
					        db.session.delete(app_token)
 | 
				
			||||||
| 
						 | 
					@ -198,9 +199,9 @@ def totp_new() -> ResponseReturnValue:
 | 
				
			||||||
    form = TOTPForm()
 | 
					    form = TOTPForm()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        totp = Totp(name=form.data['name'], secret=form.data['secret'], user=get_current_user())
 | 
					        totp = Totp(name=form.data['name'], secret=form.data['secret'])
 | 
				
			||||||
        if totp.verify(form.data['token']):
 | 
					        if totp.verify(form.data['token']):
 | 
				
			||||||
            get_current_user().totps.append(totp)
 | 
					            current_user.totps.append(totp)
 | 
				
			||||||
            db.session.commit()
 | 
					            db.session.commit()
 | 
				
			||||||
            return jsonify({
 | 
					            return jsonify({
 | 
				
			||||||
                    'status': 'ok'})
 | 
					                    'status': 'ok'})
 | 
				
			||||||
| 
						 | 
					@ -246,17 +247,9 @@ def webauthn_delete_route(webauthn_id: str) -> ResponseReturnValue:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
def webauthn_credentials(user: User) -> list[AttestedCredentialData]:
 | 
					def webauthn_credentials(user: User) -> list[AttestedCredentialData]:
 | 
				
			||||||
    """get and decode all credentials for given user"""
 | 
					    """get and decode all credentials for given user"""
 | 
				
			||||||
 | 
					    return [AttestedCredentialData.create(**cbor.decode(cred.credential_data)) for cred in user.webauthn_credentials]
 | 
				
			||||||
    def decode(creds: List[WebauthnCredential]) -> Iterator[AttestedCredentialData]:
 | 
					 | 
				
			||||||
        for cred in creds:
 | 
					 | 
				
			||||||
            data = cbor.decode(cred.credential_data)
 | 
					 | 
				
			||||||
            if isinstance(data, Mapping):
 | 
					 | 
				
			||||||
                yield AttestedCredentialData.create(**data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return list(decode(user.webauthn_credentials))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def random_string(length=32) -> str:
 | 
					def random_string(length=32) -> str:
 | 
				
			||||||
| 
						 | 
					@ -268,15 +261,14 @@ def random_string(length=32) -> str:
 | 
				
			||||||
def webauthn_pkcco_route() -> ResponseReturnValue:
 | 
					def webauthn_pkcco_route() -> ResponseReturnValue:
 | 
				
			||||||
    """get publicKeyCredentialCreationOptions"""
 | 
					    """get publicKeyCredentialCreationOptions"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    user = User.query.get(get_current_user().id) #type: Optional[User]
 | 
					    user = User.query.get(current_user.id) #type: Optional[User]
 | 
				
			||||||
    if user is None:
 | 
					    if user is None:
 | 
				
			||||||
        return 'internal error', 500
 | 
					        return 'internal error', 500
 | 
				
			||||||
    user_handle = random_string()
 | 
					    user_handle = random_string()
 | 
				
			||||||
    exclude_credentials = webauthn_credentials(user)
 | 
					    exclude_credentials = webauthn_credentials(user)
 | 
				
			||||||
    pkcco, state = webauthn.register_begin(
 | 
					    pkcco, state = webauthn.register_begin(
 | 
				
			||||||
        user=PublicKeyCredentialUserEntity(id=user_handle.encode('utf-8'), name=user.username, display_name=user.username),
 | 
					        {'id': user_handle.encode('utf-8'), 'name': user.username, 'displayName': user.username},
 | 
				
			||||||
        credentials=exclude_credentials
 | 
					        exclude_credentials)
 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    session['webauthn_register_user_handle'] = user_handle
 | 
					    session['webauthn_register_user_handle'] = user_handle
 | 
				
			||||||
    session['webauthn_register_state'] = state
 | 
					    session['webauthn_register_state'] = state
 | 
				
			||||||
    return Response(b64encode(cbor.encode(pkcco)).decode('utf-8'), mimetype='text/plain')
 | 
					    return Response(b64encode(cbor.encode(pkcco)).decode('utf-8'), mimetype='text/plain')
 | 
				
			||||||
| 
						 | 
					@ -286,20 +278,18 @@ def webauthn_pkcco_route() -> ResponseReturnValue:
 | 
				
			||||||
def webauthn_register_route() -> ResponseReturnValue:
 | 
					def webauthn_register_route() -> ResponseReturnValue:
 | 
				
			||||||
    """register credential for current user"""
 | 
					    """register credential for current user"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    user = get_current_user() # type: User 
 | 
					    user = current_user # type: User 
 | 
				
			||||||
    form = WebauthnRegisterForm()
 | 
					    form = WebauthnRegisterForm()
 | 
				
			||||||
    if form.validate_on_submit():
 | 
					    if form.validate_on_submit():
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            attestation = cbor.decode(b64decode(form.attestation.data))
 | 
					            attestation = cbor.decode(b64decode(form.attestation.data))
 | 
				
			||||||
            if not isinstance(attestation, Mapping) or 'clientDataJSON' not in attestation or 'attestationObject' not in attestation:
 | 
					 | 
				
			||||||
                return 'invalid attestion data', 400
 | 
					 | 
				
			||||||
            auth_data = webauthn.register_complete(
 | 
					            auth_data = webauthn.register_complete(
 | 
				
			||||||
                session.pop('webauthn_register_state'),
 | 
					                session.pop('webauthn_register_state'),
 | 
				
			||||||
                CollectedClientData(attestation['clientDataJSON']),
 | 
					                ClientData(attestation['clientDataJSON']),
 | 
				
			||||||
                AttestationObject(attestation['attestationObject']))
 | 
					                AttestationObject(attestation['attestationObject']))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            db.session.add(WebauthnCredential(
 | 
					            db.session.add(WebauthnCredential(
 | 
				
			||||||
                user=user,
 | 
					                user_id=user.id,
 | 
				
			||||||
                user_handle=session.pop('webauthn_register_user_handle'),
 | 
					                user_handle=session.pop('webauthn_register_user_handle'),
 | 
				
			||||||
                credential_data=cbor.encode(auth_data.credential_data.__dict__),
 | 
					                credential_data=cbor.encode(auth_data.credential_data.__dict__),
 | 
				
			||||||
                name=form.name.data))
 | 
					                name=form.name.data))
 | 
				
			||||||
| 
						 | 
					@ -326,12 +316,12 @@ def password_change_post() -> ResponseReturnValue:
 | 
				
			||||||
        password_old = str(form.data['password_old'])
 | 
					        password_old = str(form.data['password_old'])
 | 
				
			||||||
        password_new = str(form.data['password_new'])
 | 
					        password_new = str(form.data['password_new'])
 | 
				
			||||||
        if not PasswordAuthProvider.check_auth_internal(
 | 
					        if not PasswordAuthProvider.check_auth_internal(
 | 
				
			||||||
                get_current_user(), password_old):
 | 
					                current_user, password_old):
 | 
				
			||||||
            return jsonify(
 | 
					            return jsonify(
 | 
				
			||||||
                    {'errors': {'password_old': 'Old Password is invalid'}})
 | 
					                    {'errors': {'password_old': 'Old Password is invalid'}})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        get_current_user().change_password(password_new)
 | 
					        current_user.change_password(password_new)
 | 
				
			||||||
        logger.info(f"user {get_current_user().username} changed password")
 | 
					        logger.info(f"user {current_user.username} changed password")
 | 
				
			||||||
        db.session.commit()
 | 
					        db.session.commit()
 | 
				
			||||||
        return jsonify({})
 | 
					        return jsonify({})
 | 
				
			||||||
    return jsonify({'errors': form.errors})
 | 
					    return jsonify({'errors': form.errors})
 | 
				
			||||||
| 
						 | 
					@ -341,7 +331,7 @@ def password_change_post() -> ResponseReturnValue:
 | 
				
			||||||
async def oauth2_tokens() -> ResponseReturnValue:
 | 
					async def oauth2_tokens() -> ResponseReturnValue:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    subject = oauth2.custom.get('/userinfo').json()['sub']
 | 
					    subject = oauth2.custom.get('/userinfo').json()['sub']
 | 
				
			||||||
    consent_sessions = await list_o_auth_2_consent_sessions.asyncio(subject=subject, _client=hydra_service.hydra_client)
 | 
					    consent_sessions = await list_subject_consent_sessions.asyncio(subject=subject, _client=hydra_service.hydra_client)
 | 
				
			||||||
    if consent_sessions is None or isinstance( consent_sessions, GenericError):
 | 
					    if consent_sessions is None or isinstance( consent_sessions, GenericError):
 | 
				
			||||||
       return 'internal error, could not fetch sessions', 500
 | 
					       return 'internal error, could not fetch sessions', 500
 | 
				
			||||||
    return render_template(
 | 
					    return render_template(
 | 
				
			||||||
| 
						 | 
					@ -352,7 +342,7 @@ async def oauth2_tokens() -> ResponseReturnValue:
 | 
				
			||||||
@frontend_views.route('/oauth2_token/<client_id>', methods=['DELETE'])
 | 
					@frontend_views.route('/oauth2_token/<client_id>', methods=['DELETE'])
 | 
				
			||||||
async def oauth2_token_revoke(client_id: str) -> ResponseReturnValue:
 | 
					async def oauth2_token_revoke(client_id: str) -> ResponseReturnValue:
 | 
				
			||||||
    subject = oauth2.session.get('/userinfo').json()['sub']
 | 
					    subject = oauth2.session.get('/userinfo').json()['sub']
 | 
				
			||||||
    await revoke_o_auth_2_consent_sessions.asyncio_detailed( _client=hydra_service.hydra_client,
 | 
					    await revoke_consent_sessions.asyncio( _client=hydra_service.hydra_client,
 | 
				
			||||||
                                subject=subject,
 | 
					                                subject=subject,
 | 
				
			||||||
                                client=client_id)
 | 
					                                client=client_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,6 @@ from werkzeug.wrappers.response import Response as WerkzeugResponse
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..model import User, SecurityUser
 | 
					from ..model import User, SecurityUser
 | 
				
			||||||
from ..hydra import hydra_service
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
logger = logging.getLogger(__name__)
 | 
					logger = logging.getLogger(__name__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,14 +90,13 @@ def init_login_manager(app: Flask) -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oauth2.register(
 | 
					    oauth2.register(
 | 
				
			||||||
        name="custom",
 | 
					        name="custom",
 | 
				
			||||||
        client_id=hydra_service.client_id,
 | 
					        client_id=app.config['OAUTH_ID'],
 | 
				
			||||||
        client_secret=app.config['OAUTH_SECRET'],
 | 
					        client_secret=app.config['OAUTH_SECRET'],
 | 
				
			||||||
        server_metadata_url=f'{base_url}/.well-known/openid-configuration',
 | 
					 | 
				
			||||||
        access_token_url=f"{base_url}/oauth2/token",
 | 
					        access_token_url=f"{base_url}/oauth2/token",
 | 
				
			||||||
        authorize_url=f"{base_url}/oauth2/auth",
 | 
					        authorize_url=f"{base_url}/oauth2/auth",
 | 
				
			||||||
        api_base_url=base_url,
 | 
					        api_base_url=base_url,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        client_kwargs={'scope': ' '.join(['openid', 'profile', 'manage'])},
 | 
					        client_kwargs={'scope': ' '.join(['openid', 'profile', 'manage'])}
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    oauth2.init_app(app)
 | 
					    oauth2.init_app(app)
 | 
				
			||||||
    login_manager.init_app(app)
 | 
					    login_manager.init_app(app)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
# ory-hydra-client
 | 
					# ory-hydra-client
 | 
				
			||||||
A client library for accessing Ory Hydra
 | 
					A client library for accessing ORY Hydra
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Usage
 | 
					## Usage
 | 
				
			||||||
First, create a client:
 | 
					First, create a client:
 | 
				
			||||||
| 
						 | 
					@ -61,14 +61,12 @@ client = AuthenticatedClient(
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Things to know:
 | 
					Things to know:
 | 
				
			||||||
1. Every path/method combo becomes a Python module with four functions:
 | 
					1. Every path/method combo becomes a Python module with four functions:
 | 
				
			||||||
    1. `sync`: Blocking request that returns parsed data (if successful) or `None`
 | 
					    1. `sync`: Blocking request that returns parsed data (if successful) or `None`
 | 
				
			||||||
    1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
 | 
					    1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
 | 
				
			||||||
    1. `asyncio`: Like `sync` but async instead of blocking
 | 
					    1. `asyncio`: Like `sync` but the async instead of blocking
 | 
				
			||||||
    1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
 | 
					    1. `asyncio_detailed`: Like `sync_detailed` by async instead of blocking
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. All path/query params, and bodies become method arguments.
 | 
					1. All path/query params, and bodies become method arguments.
 | 
				
			||||||
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
 | 
					1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,2 @@
 | 
				
			||||||
""" A client library for accessing Ory Hydra """
 | 
					""" A client library for accessing ORY Hydra """
 | 
				
			||||||
from .client import AuthenticatedClient, Client
 | 
					from .client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					 | 
				
			||||||
__all__ = (
 | 
					 | 
				
			||||||
    "AuthenticatedClient",
 | 
					 | 
				
			||||||
    "Client",
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,27 +1,26 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from ...models.the_request_payload_used_to_accept_a_consent_request import TheRequestPayloadUsedToAcceptAConsentRequest
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.completed_request import CompletedRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.accept_consent_request import AcceptConsentRequest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _get_kwargs(
 | 
					def _get_kwargs(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
 | 
					    json_body: AcceptConsentRequest,
 | 
				
			||||||
    consent_challenge: str,
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/consent/accept".format(
 | 
					    url = "{}/oauth2/auth/requests/consent/accept".format(
 | 
				
			||||||
        _client.base_url)
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -56,72 +55,78 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					        response_200 = CompletedRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_200
 | 
					        return response_200
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync_detailed(
 | 
					def sync_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
 | 
					    json_body: AcceptConsentRequest,
 | 
				
			||||||
    consent_challenge: str,
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Accept OAuth 2.0 Consent Request
 | 
					    """Accept a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
    must now be asked if
 | 
					    he/she must now be asked if
 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
    subject's behalf.
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
    subject accepted
 | 
					    the subject accepted
 | 
				
			||||||
    or rejected the request.
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
 | 
					    This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
 | 
				
			||||||
    his/her behalf.
 | 
					    resources on his/her behalf.
 | 
				
			||||||
    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
					    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
				
			||||||
    and if the
 | 
					    and if the
 | 
				
			||||||
    consent request should be used as basis for future requests.
 | 
					    consent request should be used as basis for future requests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        consent_challenge (str):
 | 
					        consent_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
 | 
					        json_body (AcceptConsentRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,52 +142,49 @@ consent_challenge=consent_challenge,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
 | 
					    json_body: AcceptConsentRequest,
 | 
				
			||||||
    consent_challenge: str,
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Accept OAuth 2.0 Consent Request
 | 
					    """Accept a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
    must now be asked if
 | 
					    he/she must now be asked if
 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
    subject's behalf.
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
    subject accepted
 | 
					    the subject accepted
 | 
				
			||||||
    or rejected the request.
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
 | 
					    This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
 | 
				
			||||||
    his/her behalf.
 | 
					    resources on his/her behalf.
 | 
				
			||||||
    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
					    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
				
			||||||
    and if the
 | 
					    and if the
 | 
				
			||||||
    consent request should be used as basis for future requests.
 | 
					    consent request should be used as basis for future requests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        consent_challenge (str):
 | 
					        consent_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
 | 
					        json_body (AcceptConsentRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -196,47 +198,44 @@ consent_challenge=consent_challenge,
 | 
				
			||||||
async def asyncio_detailed(
 | 
					async def asyncio_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
 | 
					    json_body: AcceptConsentRequest,
 | 
				
			||||||
    consent_challenge: str,
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Accept OAuth 2.0 Consent Request
 | 
					    """Accept a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
    must now be asked if
 | 
					    he/she must now be asked if
 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
    subject's behalf.
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
    subject accepted
 | 
					    the subject accepted
 | 
				
			||||||
    or rejected the request.
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
 | 
					    This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
 | 
				
			||||||
    his/her behalf.
 | 
					    resources on his/her behalf.
 | 
				
			||||||
    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
					    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
				
			||||||
    and if the
 | 
					    and if the
 | 
				
			||||||
    consent request should be used as basis for future requests.
 | 
					    consent request should be used as basis for future requests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        consent_challenge (str):
 | 
					        consent_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
 | 
					        json_body (AcceptConsentRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -252,52 +251,49 @@ consent_challenge=consent_challenge,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
 | 
					    json_body: AcceptConsentRequest,
 | 
				
			||||||
    consent_challenge: str,
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Accept OAuth 2.0 Consent Request
 | 
					    """Accept a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
    must now be asked if
 | 
					    he/she must now be asked if
 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
    subject's behalf.
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
    subject accepted
 | 
					    the subject accepted
 | 
				
			||||||
    or rejected the request.
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
 | 
					    This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
 | 
				
			||||||
    his/her behalf.
 | 
					    resources on his/her behalf.
 | 
				
			||||||
    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
					    The consent provider includes additional information, such as session data for access and ID tokens,
 | 
				
			||||||
    and if the
 | 
					    and if the
 | 
				
			||||||
    consent request should be used as basis for future requests.
 | 
					    consent request should be used as basis for future requests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        consent_challenge (str):
 | 
					        consent_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
 | 
					        json_body (AcceptConsentRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,298 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.completed_request import CompletedRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.accept_login_request import AcceptLoginRequest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: AcceptLoginRequest,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/login/accept".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["login_challenge"] = login_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "put",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = CompletedRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: AcceptLoginRequest,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
 | 
				
			||||||
 | 
					    additional information such as
 | 
				
			||||||
 | 
					    the subject's ID and if ORY Hydra should remember the subject's subject agent for future
 | 
				
			||||||
 | 
					    authentication attempts by setting
 | 
				
			||||||
 | 
					    a cookie.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					        json_body (AcceptLoginRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: AcceptLoginRequest,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
 | 
				
			||||||
 | 
					    additional information such as
 | 
				
			||||||
 | 
					    the subject's ID and if ORY Hydra should remember the subject's subject agent for future
 | 
				
			||||||
 | 
					    authentication attempts by setting
 | 
				
			||||||
 | 
					    a cookie.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					        json_body (AcceptLoginRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: AcceptLoginRequest,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
 | 
				
			||||||
 | 
					    additional information such as
 | 
				
			||||||
 | 
					    the subject's ID and if ORY Hydra should remember the subject's subject agent for future
 | 
				
			||||||
 | 
					    authentication attempts by setting
 | 
				
			||||||
 | 
					    a cookie.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					        json_body (AcceptLoginRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: AcceptLoginRequest,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
 | 
				
			||||||
 | 
					    additional information such as
 | 
				
			||||||
 | 
					    the subject's ID and if ORY Hydra should remember the subject's subject agent for future
 | 
				
			||||||
 | 
					    authentication attempts by setting
 | 
				
			||||||
 | 
					    a cookie.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					        json_body (AcceptLoginRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,209 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.completed_request import CompletedRequest
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/logout/accept".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["logout_challenge"] = logout_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "put",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = CompletedRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Accept a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,16 +1,15 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					from typing import Dict
 | 
				
			||||||
from ...models.json_web_key_set import JsonWebKeySet
 | 
					from typing import cast
 | 
				
			||||||
from ...models.create_json_web_key_set import CreateJsonWebKeySet
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.json_web_key_set import JSONWebKeySet
 | 
				
			||||||
 | 
					from ...models.json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,10 +17,10 @@ def _get_kwargs(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: CreateJsonWebKeySet,
 | 
					    json_body: JsonWebKeySetGeneratorRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/keys/{set}".format(
 | 
					    url = "{}/keys/{set}".format(
 | 
				
			||||||
        _client.base_url,set=set_)
 | 
					        _client.base_url,set=set_)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -49,25 +48,40 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.CREATED:
 | 
					    if response.status_code == HTTPStatus.CREATED:
 | 
				
			||||||
        response_201 = JsonWebKeySet.from_dict(response.json())
 | 
					        response_201 = JSONWebKeySet.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_201
 | 
					        return response_201
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,10 +89,10 @@ def sync_detailed(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: CreateJsonWebKeySet,
 | 
					    json_body: JsonWebKeySetGeneratorRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Create JSON Web Key
 | 
					    """Generate a New JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
					     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
				
			||||||
    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
					    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
				
			||||||
| 
						 | 
					@ -92,14 +106,10 @@ def sync_detailed(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
 | 
					        json_body (JsonWebKeySetGeneratorRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -115,16 +125,16 @@ json_body=json_body,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: CreateJsonWebKeySet,
 | 
					    json_body: JsonWebKeySetGeneratorRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Create JSON Web Key
 | 
					    """Generate a New JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
					     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
				
			||||||
    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
					    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
				
			||||||
| 
						 | 
					@ -138,14 +148,10 @@ def sync(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
 | 
					        json_body (JsonWebKeySetGeneratorRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -160,10 +166,10 @@ async def asyncio_detailed(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: CreateJsonWebKeySet,
 | 
					    json_body: JsonWebKeySetGeneratorRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Create JSON Web Key
 | 
					    """Generate a New JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
					     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
				
			||||||
    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
					    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
				
			||||||
| 
						 | 
					@ -177,14 +183,10 @@ async def asyncio_detailed(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
 | 
					        json_body (JsonWebKeySetGeneratorRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -200,16 +202,16 @@ json_body=json_body,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: CreateJsonWebKeySet,
 | 
					    json_body: JsonWebKeySetGeneratorRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Create JSON Web Key
 | 
					    """Generate a New JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
					     This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
 | 
				
			||||||
    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
					    available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
 | 
				
			||||||
| 
						 | 
					@ -223,14 +225,10 @@ async def asyncio(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
 | 
					        json_body (JsonWebKeySetGeneratorRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,223 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.o_auth_2_client import OAuth2Client
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/clients".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "post",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.CREATED:
 | 
				
			||||||
 | 
					        response_201 = OAuth2Client.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_201
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.CONFLICT:
 | 
				
			||||||
 | 
					        response_409 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_409
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Create an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
 | 
				
			||||||
 | 
					    random secret will be generated. The secret will be returned in the response and you will not be
 | 
				
			||||||
 | 
					    able to retrieve it later on. Write the secret down and keep it somwhere safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Create an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
 | 
				
			||||||
 | 
					    random secret will be generated. The secret will be returned in the response and you will not be
 | 
				
			||||||
 | 
					    able to retrieve it later on. Write the secret down and keep it somwhere safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Create an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
 | 
				
			||||||
 | 
					    random secret will be generated. The secret will be returned in the response and you will not be
 | 
				
			||||||
 | 
					    able to retrieve it later on. Write the secret down and keep it somwhere safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Create an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
 | 
				
			||||||
 | 
					    random secret will be generated. The secret will be returned in the response and you will not be
 | 
				
			||||||
 | 
					    able to retrieve it later on. Write the secret down and keep it somwhere safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,225 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/keys/{set}/{kid}".format(
 | 
				
			||||||
 | 
					        _client.base_url,set=set_,kid=kid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a single JSON Web Key.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a single JSON Web Key.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a single JSON Web Key.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a single JSON Web Key.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,212 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/keys/{set}".format(
 | 
				
			||||||
 | 
					        _client.base_url,set=set_)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
				
			||||||
 | 
					    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
				
			||||||
 | 
					    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
				
			||||||
 | 
					    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
				
			||||||
 | 
					    keys as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,202 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/clients/{id}".format(
 | 
				
			||||||
 | 
					        _client.base_url,id=id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Deletes an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Delete an existing OAuth 2.0 Client by its ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Deletes an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Delete an existing OAuth 2.0 Client by its ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Deletes an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Delete an existing OAuth 2.0 Client by its ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Deletes an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Delete an existing OAuth 2.0 Client by its ID.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,189 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    client_id: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/tokens".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["client_id"] = client_id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    client_id: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete OAuth2 Access Tokens from a Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint deletes OAuth2 access tokens issued for a client from the database
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        client_id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					client_id=client_id,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    client_id: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete OAuth2 Access Tokens from a Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint deletes OAuth2 access tokens issued for a client from the database
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        client_id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					client_id=client_id,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    client_id: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete OAuth2 Access Tokens from a Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint deletes OAuth2 access tokens issued for a client from the database
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        client_id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					client_id=client_id,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    client_id: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Delete OAuth2 Access Tokens from a Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint deletes OAuth2 access tokens issued for a client from the database
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        client_id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					client_id=client_id,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,202 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.flush_inactive_o_auth_2_tokens_request import FlushInactiveOAuth2TokensRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: FlushInactiveOAuth2TokensRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/flush".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "post",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: FlushInactiveOAuth2TokensRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Flush Expired OAuth2 Access Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
 | 
				
			||||||
 | 
					    no tokens will be
 | 
				
			||||||
 | 
					    not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
 | 
				
			||||||
 | 
					    flushed as they are deleted
 | 
				
			||||||
 | 
					    automatically when performing the refresh flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (FlushInactiveOAuth2TokensRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: FlushInactiveOAuth2TokensRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Flush Expired OAuth2 Access Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
 | 
				
			||||||
 | 
					    no tokens will be
 | 
				
			||||||
 | 
					    not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
 | 
				
			||||||
 | 
					    flushed as they are deleted
 | 
				
			||||||
 | 
					    automatically when performing the refresh flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (FlushInactiveOAuth2TokensRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: FlushInactiveOAuth2TokensRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Flush Expired OAuth2 Access Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
 | 
				
			||||||
 | 
					    no tokens will be
 | 
				
			||||||
 | 
					    not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
 | 
				
			||||||
 | 
					    flushed as they are deleted
 | 
				
			||||||
 | 
					    automatically when performing the refresh flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (FlushInactiveOAuth2TokensRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: FlushInactiveOAuth2TokensRequest,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Flush Expired OAuth2 Access Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
 | 
				
			||||||
 | 
					    no tokens will be
 | 
				
			||||||
 | 
					    not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
 | 
				
			||||||
 | 
					    flushed as they are deleted
 | 
				
			||||||
 | 
					    automatically when performing the refresh flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        json_body (FlushInactiveOAuth2TokensRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,263 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.consent_request import ConsentRequest
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/consent".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["consent_challenge"] = consent_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = ConsentRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.CONFLICT:
 | 
				
			||||||
 | 
					        response_409 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_409
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Get Consent Request Information
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[ConsentRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Get Consent Request Information
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[ConsentRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Get Consent Request Information
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[ConsentRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[ConsentRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Get Consent Request Information
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[ConsentRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,199 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.json_web_key_set import JSONWebKeySet
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/keys/{set}/{kid}".format(
 | 
				
			||||||
 | 
					        _client.base_url,set=set_,kid=kid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = JSONWebKeySet.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    """Fetch a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    """Fetch a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    """Fetch a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    set_: str,
 | 
				
			||||||
 | 
					    kid: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
 | 
					    """Fetch a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					        kid (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        set_=set_,
 | 
				
			||||||
 | 
					kid=kid,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,14 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from ...models.json_web_key_set import JSONWebKeySet
 | 
				
			||||||
from typing import cast
 | 
					from typing import cast
 | 
				
			||||||
from typing import Dict
 | 
					from typing import Dict
 | 
				
			||||||
from ...models.json_web_key_set import JsonWebKeySet
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +18,7 @@ def _get_kwargs(
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/keys/{set}".format(
 | 
					    url = "{}/keys/{set}".format(
 | 
				
			||||||
        _client.base_url,set=set_)
 | 
					        _client.base_url,set=set_)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -44,25 +43,40 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = JsonWebKeySet.from_dict(response.json())
 | 
					        response_200 = JSONWebKeySet.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_200
 | 
					        return response_200
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -71,7 +85,7 @@ def sync_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Retrieve a JSON Web Key Set
 | 
					    """Retrieve a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
					     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
				
			||||||
| 
						 | 
					@ -85,12 +99,8 @@ def sync_detailed(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,14 +115,14 @@ _client=_client,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Retrieve a JSON Web Key Set
 | 
					    """Retrieve a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
					     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
				
			||||||
| 
						 | 
					@ -126,12 +136,8 @@ def sync(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,7 +152,7 @@ async def asyncio_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Retrieve a JSON Web Key Set
 | 
					    """Retrieve a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
					     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
				
			||||||
| 
						 | 
					@ -160,12 +166,8 @@ async def asyncio_detailed(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -180,14 +182,14 @@ _client=_client,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Retrieve a JSON Web Key Set
 | 
					    """Retrieve a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
					     This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
 | 
				
			||||||
| 
						 | 
					@ -201,12 +203,8 @@ async def asyncio(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,249 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.login_request import LoginRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/login".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["login_challenge"] = login_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = LoginRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.CONFLICT:
 | 
				
			||||||
 | 
					        response_409 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_409
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    """Get a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LoginRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    """Get a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LoginRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    """Get a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LoginRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, LoginRequest]]:
 | 
				
			||||||
 | 
					    """Get a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        login_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LoginRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					login_challenge=login_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,193 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.logout_request import LogoutRequest
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/logout".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["logout_challenge"] = logout_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = LogoutRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    """Get a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to fetch a logout request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LogoutRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    """Get a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to fetch a logout request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LogoutRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    """Get a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to fetch a logout request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LogoutRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, LogoutRequest]]:
 | 
				
			||||||
 | 
					    """Get a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Use this endpoint to fetch a logout request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, LogoutRequest]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,206 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.o_auth_2_client import OAuth2Client
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/clients/{id}".format(
 | 
				
			||||||
 | 
					        _client.base_url,id=id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = OAuth2Client.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Get an OAuth 2.0 Client.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Get an OAuth 2.0 Client.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Get an OAuth 2.0 Client.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Get an OAuth 2.0 Client.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										164
									
								
								libs/ory-hydra-client/ory_hydra_client/api/admin/get_version.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										164
									
								
								libs/ory-hydra-client/ory_hydra_client/api/admin/get_version.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,164 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.version import Version
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/version".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Version]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = Version.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Version]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Version]:
 | 
				
			||||||
 | 
					    """Get Service Version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns the service version typically notated using semantic versioning.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Version]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Version]:
 | 
				
			||||||
 | 
					    """Get Service Version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns the service version typically notated using semantic versioning.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Version]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Version]:
 | 
				
			||||||
 | 
					    """Get Service Version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns the service version typically notated using semantic versioning.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Version]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Version]:
 | 
				
			||||||
 | 
					    """Get Service Version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint returns the service version typically notated using semantic versioning.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Version]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,194 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
 | 
				
			||||||
 | 
					from ...models.o_auth_2_token_introspection import OAuth2TokenIntrospection
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/introspect".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "post",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = OAuth2TokenIntrospection.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    """Introspect OAuth2 Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
				
			||||||
 | 
					    active token
 | 
				
			||||||
 | 
					    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
				
			||||||
 | 
					    included. You can
 | 
				
			||||||
 | 
					    set additional data for a token by setting `accessTokenExtra` during the consent flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
 | 
				
			||||||
 | 
					    endpoint/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2TokenIntrospection]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    """Introspect OAuth2 Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
				
			||||||
 | 
					    active token
 | 
				
			||||||
 | 
					    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
				
			||||||
 | 
					    included. You can
 | 
				
			||||||
 | 
					    set additional data for a token by setting `accessTokenExtra` during the consent flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
 | 
				
			||||||
 | 
					    endpoint/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2TokenIntrospection]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    """Introspect OAuth2 Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
				
			||||||
 | 
					    active token
 | 
				
			||||||
 | 
					    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
				
			||||||
 | 
					    included. You can
 | 
				
			||||||
 | 
					    set additional data for a token by setting `accessTokenExtra` during the consent flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
 | 
				
			||||||
 | 
					    endpoint/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2TokenIntrospection]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
 | 
				
			||||||
 | 
					    """Introspect OAuth2 Tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
				
			||||||
 | 
					    active token
 | 
				
			||||||
 | 
					    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
				
			||||||
 | 
					    included. You can
 | 
				
			||||||
 | 
					    set additional data for a token by setting `accessTokenExtra` during the consent flow.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
 | 
				
			||||||
 | 
					    endpoint/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2TokenIntrospection]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,16 +1,14 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...models.generic_error import GenericError
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
from ...models.health_status import HealthStatus
 | 
					from ...models.health_status import HealthStatus
 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,7 +42,7 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[GenericError, HealthStatus]]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = HealthStatus.from_dict(response.json())
 | 
					        response_200 = HealthStatus.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,18 +55,15 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_500
 | 
					        return response_500
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    return None
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[GenericError, HealthStatus]]:
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,11 +72,10 @@ def sync_detailed(
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[Union[GenericError, HealthStatus]]:
 | 
					) -> Response[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    """Check HTTP Server Status
 | 
					    """Check Alive Status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
 | 
					     This endpoint returns a 200 status code when the HTTP server is up running.
 | 
				
			||||||
    HTTP requests. This status does currently not include checks whether the database connection is
 | 
					    This status does currently not include checks whether the database connection is working.
 | 
				
			||||||
    working.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
| 
						 | 
					@ -89,10 +83,6 @@ def sync_detailed(
 | 
				
			||||||
    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
					    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					    refer to the cluster state, only to a single instance.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[Union[GenericError, HealthStatus]]
 | 
					        Response[Union[GenericError, HealthStatus]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					@ -108,18 +98,17 @@ def sync_detailed(
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[Union[GenericError, HealthStatus]]:
 | 
					) -> Optional[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    """Check HTTP Server Status
 | 
					    """Check Alive Status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
 | 
					     This endpoint returns a 200 status code when the HTTP server is up running.
 | 
				
			||||||
    HTTP requests. This status does currently not include checks whether the database connection is
 | 
					    This status does currently not include checks whether the database connection is working.
 | 
				
			||||||
    working.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
| 
						 | 
					@ -127,10 +116,6 @@ def sync(
 | 
				
			||||||
    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
					    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					    refer to the cluster state, only to a single instance.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[Union[GenericError, HealthStatus]]
 | 
					        Response[Union[GenericError, HealthStatus]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					@ -146,11 +131,10 @@ async def asyncio_detailed(
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[Union[GenericError, HealthStatus]]:
 | 
					) -> Response[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    """Check HTTP Server Status
 | 
					    """Check Alive Status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
 | 
					     This endpoint returns a 200 status code when the HTTP server is up running.
 | 
				
			||||||
    HTTP requests. This status does currently not include checks whether the database connection is
 | 
					    This status does currently not include checks whether the database connection is working.
 | 
				
			||||||
    working.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
| 
						 | 
					@ -158,10 +142,6 @@ async def asyncio_detailed(
 | 
				
			||||||
    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
					    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					    refer to the cluster state, only to a single instance.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[Union[GenericError, HealthStatus]]
 | 
					        Response[Union[GenericError, HealthStatus]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					@ -177,18 +157,17 @@ async def asyncio_detailed(
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[Union[GenericError, HealthStatus]]:
 | 
					) -> Optional[Union[GenericError, HealthStatus]]:
 | 
				
			||||||
    """Check HTTP Server Status
 | 
					    """Check Alive Status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
 | 
					     This endpoint returns a 200 status code when the HTTP server is up running.
 | 
				
			||||||
    HTTP requests. This status does currently not include checks whether the database connection is
 | 
					    This status does currently not include checks whether the database connection is working.
 | 
				
			||||||
    working.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
| 
						 | 
					@ -196,10 +175,6 @@ async def asyncio(
 | 
				
			||||||
    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
					    Be aware that if you are running multiple nodes of this service, the health status will never
 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					    refer to the cluster state, only to a single instance.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[Union[GenericError, HealthStatus]]
 | 
					        Response[Union[GenericError, HealthStatus]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,260 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import Union
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...types import UNSET, Unset
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast, List
 | 
				
			||||||
 | 
					from ...models.o_auth_2_client import OAuth2Client
 | 
				
			||||||
 | 
					from typing import Optional
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    limit: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					    offset: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/clients".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["limit"] = limit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params["offset"] = offset
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = []
 | 
				
			||||||
 | 
					        _response_200 = response.json()
 | 
				
			||||||
 | 
					        for response_200_item_data in (_response_200):
 | 
				
			||||||
 | 
					            response_200_item = OAuth2Client.from_dict(response_200_item_data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            response_200.append(response_200_item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    limit: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					    offset: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    """List OAuth 2.0 Clients
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all clients in the database, and never returns client secrets. As a default it
 | 
				
			||||||
 | 
					    lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
 | 
				
			||||||
 | 
					    an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        limit (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					        offset (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['OAuth2Client']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					limit=limit,
 | 
				
			||||||
 | 
					offset=offset,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    limit: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					    offset: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    """List OAuth 2.0 Clients
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all clients in the database, and never returns client secrets. As a default it
 | 
				
			||||||
 | 
					    lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
 | 
				
			||||||
 | 
					    an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        limit (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					        offset (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['OAuth2Client']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					limit=limit,
 | 
				
			||||||
 | 
					offset=offset,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    limit: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					    offset: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    """List OAuth 2.0 Clients
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all clients in the database, and never returns client secrets. As a default it
 | 
				
			||||||
 | 
					    lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
 | 
				
			||||||
 | 
					    an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        limit (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					        offset (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['OAuth2Client']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					limit=limit,
 | 
				
			||||||
 | 
					offset=offset,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    limit: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					    offset: Union[Unset, None, int] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, List['OAuth2Client']]]:
 | 
				
			||||||
 | 
					    """List OAuth 2.0 Clients
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all clients in the database, and never returns client secrets. As a default it
 | 
				
			||||||
 | 
					    lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
 | 
				
			||||||
 | 
					    an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        limit (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					        offset (Union[Unset, None, int]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['OAuth2Client']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					limit=limit,
 | 
				
			||||||
 | 
					offset=offset,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,239 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from ...models.previous_consent_session import PreviousConsentSession
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast, List
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/sessions/consent".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["subject"] = subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = []
 | 
				
			||||||
 | 
					        _response_200 = response.json()
 | 
				
			||||||
 | 
					        for response_200_item_data in (_response_200):
 | 
				
			||||||
 | 
					            response_200_item = PreviousConsentSession.from_dict(response_200_item_data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            response_200.append(response_200_item)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    """Lists All Consent Sessions of a Subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
				
			||||||
 | 
					    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
				
			||||||
 | 
					    empty JSON array with status code 200 OK.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-
 | 
				
			||||||
 | 
					    url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['PreviousConsentSession']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    """Lists All Consent Sessions of a Subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
				
			||||||
 | 
					    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
				
			||||||
 | 
					    empty JSON array with status code 200 OK.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-
 | 
				
			||||||
 | 
					    url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['PreviousConsentSession']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    """Lists All Consent Sessions of a Subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
				
			||||||
 | 
					    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
				
			||||||
 | 
					    empty JSON array with status code 200 OK.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-
 | 
				
			||||||
 | 
					    url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['PreviousConsentSession']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
 | 
				
			||||||
 | 
					    """Lists All Consent Sessions of a Subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
				
			||||||
 | 
					    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
				
			||||||
 | 
					    empty JSON array with status code 200 OK.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The \"Link\" header is also included in successful responses, which contains one or more links for
 | 
				
			||||||
 | 
					    pagination, formatted like so: '<https://hydra-
 | 
				
			||||||
 | 
					    url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
 | 
				
			||||||
 | 
					    rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
 | 
				
			||||||
 | 
					    'previous'.
 | 
				
			||||||
 | 
					    Multiple links can be included in this header, and will be separated by a comma.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, List['PreviousConsentSession']]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										125
									
								
								libs/ory-hydra-client/ory_hydra_client/api/admin/prometheus.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								libs/ory-hydra-client/ory_hydra_client/api/admin/prometheus.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,125 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/metrics/prometheus".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "get",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Any]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=None,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Any]:
 | 
				
			||||||
 | 
					    """Get Snapshot Metrics from the Hydra Service.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     If you're using k8s, you can then add annotations to your deployment like so:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					    metadata:
 | 
				
			||||||
 | 
					    annotations:
 | 
				
			||||||
 | 
					    prometheus.io/port: \"4445\"
 | 
				
			||||||
 | 
					    prometheus.io/path: \"/metrics/prometheus\"
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Any]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Any]:
 | 
				
			||||||
 | 
					    """Get Snapshot Metrics from the Hydra Service.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     If you're using k8s, you can then add annotations to your deployment like so:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					    metadata:
 | 
				
			||||||
 | 
					    annotations:
 | 
				
			||||||
 | 
					    prometheus.io/port: \"4445\"
 | 
				
			||||||
 | 
					    prometheus.io/path: \"/metrics/prometheus\"
 | 
				
			||||||
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
				
			||||||
 | 
					    `X-Forwarded-Proto` header to be set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Any]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,298 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.reject_request import RejectRequest
 | 
				
			||||||
 | 
					from ...models.completed_request import CompletedRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/consent/reject".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["consent_challenge"] = consent_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "put",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = CompletedRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
 | 
				
			||||||
 | 
					    resources on his/her behalf.
 | 
				
			||||||
 | 
					    The consent provider must include a reason why the consent was not granted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
 | 
				
			||||||
 | 
					    resources on his/her behalf.
 | 
				
			||||||
 | 
					    The consent provider must include a reason why the consent was not granted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
 | 
				
			||||||
 | 
					    resources on his/her behalf.
 | 
				
			||||||
 | 
					    The consent provider must include a reason why the consent was not granted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    consent_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Consent Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
 | 
					    login provider
 | 
				
			||||||
 | 
					    to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
 | 
				
			||||||
 | 
					    he/she must now be asked if
 | 
				
			||||||
 | 
					    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
				
			||||||
 | 
					    subject's behalf.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent provider which handles this request and is a web app implemented and hosted by you. It
 | 
				
			||||||
 | 
					    shows a subject interface which asks the subject to
 | 
				
			||||||
 | 
					    grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
 | 
				
			||||||
 | 
					    access to all your private files\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
				
			||||||
 | 
					    (browser) is redirected to. The consent
 | 
				
			||||||
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
 | 
				
			||||||
 | 
					    the subject accepted
 | 
				
			||||||
 | 
					    or rejected the request.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
 | 
				
			||||||
 | 
					    resources on his/her behalf.
 | 
				
			||||||
 | 
					    The consent provider must include a reason why the consent was not granted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        consent_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					consent_challenge=consent_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,27 +1,26 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					from typing import Dict
 | 
				
			||||||
from ...models.the_request_payload_used_to_accept_a_login_or_consent_request import TheRequestPayloadUsedToAcceptALoginOrConsentRequest
 | 
					 | 
				
			||||||
from typing import cast
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.reject_request import RejectRequest
 | 
				
			||||||
 | 
					from ...models.completed_request import CompletedRequest
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _get_kwargs(
 | 
					def _get_kwargs(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
    login_challenge: str,
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/login/reject".format(
 | 
					    url = "{}/oauth2/auth/requests/login/reject".format(
 | 
				
			||||||
        _client.base_url)
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -56,62 +55,83 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					        response_200 = CompletedRequest.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_200
 | 
					        return response_200
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync_detailed(
 | 
					def sync_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
    login_challenge: str,
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Reject OAuth 2.0 Login Request
 | 
					    """Reject a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
    the requested authentication process.
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has not authenticated and includes a reason why the
 | 
					    This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
 | 
				
			||||||
    authentication
 | 
					    authentication
 | 
				
			||||||
    was denied.
 | 
					    was be denied.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        login_challenge (str):
 | 
					        login_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -127,42 +147,42 @@ login_challenge=login_challenge,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
    login_challenge: str,
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Reject OAuth 2.0 Login Request
 | 
					    """Reject a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
    the requested authentication process.
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has not authenticated and includes a reason why the
 | 
					    This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
 | 
				
			||||||
    authentication
 | 
					    authentication
 | 
				
			||||||
    was denied.
 | 
					    was be denied.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        login_challenge (str):
 | 
					        login_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,37 +196,37 @@ login_challenge=login_challenge,
 | 
				
			||||||
async def asyncio_detailed(
 | 
					async def asyncio_detailed(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
    login_challenge: str,
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					) -> Response[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Reject OAuth 2.0 Login Request
 | 
					    """Reject a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
    the requested authentication process.
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has not authenticated and includes a reason why the
 | 
					    This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
 | 
				
			||||||
    authentication
 | 
					    authentication
 | 
				
			||||||
    was denied.
 | 
					    was be denied.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        login_challenge (str):
 | 
					        login_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -222,42 +242,42 @@ login_challenge=login_challenge,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
    login_challenge: str,
 | 
					    login_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					) -> Optional[Union[CompletedRequest, GenericError]]:
 | 
				
			||||||
    """Reject OAuth 2.0 Login Request
 | 
					    """Reject a Login Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
 | 
				
			||||||
    provider
 | 
					    login provider
 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					    (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
 | 
				
			||||||
 | 
					    about it. The login
 | 
				
			||||||
 | 
					    provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
 | 
				
			||||||
 | 
					    login screen\")
 | 
				
			||||||
 | 
					    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					    (browser) is redirected to. The login
 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
				
			||||||
    the requested authentication process.
 | 
					    the requested authentication process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    This endpoint tells Ory that the subject has not authenticated and includes a reason why the
 | 
					    This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
 | 
				
			||||||
    authentication
 | 
					    authentication
 | 
				
			||||||
    was denied.
 | 
					    was be denied.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        login_challenge (str):
 | 
					        login_challenge (str):
 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					        Response[Union[CompletedRequest, GenericError]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,222 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.reject_request import RejectRequest
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/requests/logout/reject".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["logout_challenge"] = logout_challenge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "put",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response is empty as the logout provider has to chose what action to perform next.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response is empty as the logout provider has to chose what action to perform next.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response is empty as the logout provider has to chose what action to perform next.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: RejectRequest,
 | 
				
			||||||
 | 
					    logout_challenge: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Reject a Logout Request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
 | 
				
			||||||
 | 
					    that logout request.
 | 
				
			||||||
 | 
					    No body is required.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    The response is empty as the logout provider has to chose what action to perform next.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        logout_challenge (str):
 | 
				
			||||||
 | 
					        json_body (RejectRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					logout_challenge=logout_challenge,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,215 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/sessions/login".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["subject"] = subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Invalidates All Login Sessions of a Certain User
 | 
				
			||||||
 | 
					    Invalidates a Subject's Authentication Session
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
				
			||||||
 | 
					    session, the subject
 | 
				
			||||||
 | 
					    has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
 | 
				
			||||||
 | 
					    with OpenID Connect
 | 
				
			||||||
 | 
					    Front- or Back-channel logout.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Invalidates All Login Sessions of a Certain User
 | 
				
			||||||
 | 
					    Invalidates a Subject's Authentication Session
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
				
			||||||
 | 
					    session, the subject
 | 
				
			||||||
 | 
					    has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
 | 
				
			||||||
 | 
					    with OpenID Connect
 | 
				
			||||||
 | 
					    Front- or Back-channel logout.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Invalidates All Login Sessions of a Certain User
 | 
				
			||||||
 | 
					    Invalidates a Subject's Authentication Session
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
				
			||||||
 | 
					    session, the subject
 | 
				
			||||||
 | 
					    has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
 | 
				
			||||||
 | 
					    with OpenID Connect
 | 
				
			||||||
 | 
					    Front- or Back-channel logout.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Invalidates All Login Sessions of a Certain User
 | 
				
			||||||
 | 
					    Invalidates a Subject's Authentication Session
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
				
			||||||
 | 
					    session, the subject
 | 
				
			||||||
 | 
					    has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
 | 
				
			||||||
 | 
					    with OpenID Connect
 | 
				
			||||||
 | 
					    Front- or Back-channel logout.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,238 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					from typing import Union
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...types import UNSET, Unset
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import Optional
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					    client: Union[Unset, None, str] = UNSET,
 | 
				
			||||||
 | 
					    all_: Union[Unset, None, bool] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/oauth2/auth/sessions/consent".format(
 | 
				
			||||||
 | 
					        _client.base_url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params: Dict[str, Any] = {}
 | 
				
			||||||
 | 
					    params["subject"] = subject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params["client"] = client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params["all"] = all_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "delete",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "params": params,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
				
			||||||
 | 
					        response_204 = cast(Any, None)
 | 
				
			||||||
 | 
					        return response_204
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
				
			||||||
 | 
					        response_400 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_400
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
				
			||||||
 | 
					        response_404 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_404
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					    client: Union[Unset, None, str] = UNSET,
 | 
				
			||||||
 | 
					    all_: Union[Unset, None, bool] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
 | 
				
			||||||
 | 
					    invalidates all
 | 
				
			||||||
 | 
					    associated OAuth 2.0 Access Tokens.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					        client (Union[Unset, None, str]):
 | 
				
			||||||
 | 
					        all_ (Union[Unset, None, bool]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					client=client,
 | 
				
			||||||
 | 
					all_=all_,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					    client: Union[Unset, None, str] = UNSET,
 | 
				
			||||||
 | 
					    all_: Union[Unset, None, bool] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
 | 
				
			||||||
 | 
					    invalidates all
 | 
				
			||||||
 | 
					    associated OAuth 2.0 Access Tokens.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					        client (Union[Unset, None, str]):
 | 
				
			||||||
 | 
					        all_ (Union[Unset, None, bool]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					client=client,
 | 
				
			||||||
 | 
					all_=all_,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					    client: Union[Unset, None, str] = UNSET,
 | 
				
			||||||
 | 
					    all_: Union[Unset, None, bool] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
 | 
				
			||||||
 | 
					    invalidates all
 | 
				
			||||||
 | 
					    associated OAuth 2.0 Access Tokens.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					        client (Union[Unset, None, str]):
 | 
				
			||||||
 | 
					        all_ (Union[Unset, None, bool]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					client=client,
 | 
				
			||||||
 | 
					all_=all_,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    subject: str,
 | 
				
			||||||
 | 
					    client: Union[Unset, None, str] = UNSET,
 | 
				
			||||||
 | 
					    all_: Union[Unset, None, bool] = UNSET,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[Any, GenericError]]:
 | 
				
			||||||
 | 
					    """Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
 | 
				
			||||||
 | 
					    invalidates all
 | 
				
			||||||
 | 
					    associated OAuth 2.0 Access Tokens.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        subject (str):
 | 
				
			||||||
 | 
					        client (Union[Unset, None, str]):
 | 
				
			||||||
 | 
					        all_ (Union[Unset, None, bool]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[Any, GenericError]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        _client=_client,
 | 
				
			||||||
 | 
					subject=subject,
 | 
				
			||||||
 | 
					client=client,
 | 
				
			||||||
 | 
					all_=all_,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,14 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from typing import Dict
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
from ...models.json_web_key import JsonWebKey
 | 
					 | 
				
			||||||
from typing import cast
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.json_web_key import JSONWebKey
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,10 +17,10 @@ def _get_kwargs(
 | 
				
			||||||
    kid: str,
 | 
					    kid: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKey,
 | 
					    json_body: JSONWebKey,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/keys/{set}/{kid}".format(
 | 
					    url = "{}/keys/{set}/{kid}".format(
 | 
				
			||||||
        _client.base_url,set=set_,kid=kid)
 | 
					        _client.base_url,set=set_,kid=kid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -49,25 +48,40 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKey]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = JsonWebKey.from_dict(response.json())
 | 
					        response_200 = JSONWebKey.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_200
 | 
					        return response_200
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKey]:
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,10 +90,10 @@ def sync_detailed(
 | 
				
			||||||
    kid: str,
 | 
					    kid: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKey,
 | 
					    json_body: JSONWebKey,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKey]:
 | 
					) -> Response[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    """Set JSON Web Key
 | 
					    """Update a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
    own.
 | 
					    own.
 | 
				
			||||||
| 
						 | 
					@ -93,14 +107,12 @@ def sync_detailed(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        kid (str):
 | 
					        kid (str):
 | 
				
			||||||
        json_body (JsonWebKey):
 | 
					        json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
 | 
				
			||||||
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
    Raises:
 | 
					            JSONWebKey.
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKey]
 | 
					        Response[Union[GenericError, JSONWebKey]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -117,17 +129,17 @@ json_body=json_body,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    kid: str,
 | 
					    kid: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKey,
 | 
					    json_body: JSONWebKey,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKey]:
 | 
					) -> Optional[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    """Set JSON Web Key
 | 
					    """Update a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
    own.
 | 
					    own.
 | 
				
			||||||
| 
						 | 
					@ -141,14 +153,12 @@ def sync(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        kid (str):
 | 
					        kid (str):
 | 
				
			||||||
        json_body (JsonWebKey):
 | 
					        json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
 | 
				
			||||||
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
    Raises:
 | 
					            JSONWebKey.
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKey]
 | 
					        Response[Union[GenericError, JSONWebKey]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -165,10 +175,10 @@ async def asyncio_detailed(
 | 
				
			||||||
    kid: str,
 | 
					    kid: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKey,
 | 
					    json_body: JSONWebKey,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKey]:
 | 
					) -> Response[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    """Set JSON Web Key
 | 
					    """Update a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
    own.
 | 
					    own.
 | 
				
			||||||
| 
						 | 
					@ -182,14 +192,12 @@ async def asyncio_detailed(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        kid (str):
 | 
					        kid (str):
 | 
				
			||||||
        json_body (JsonWebKey):
 | 
					        json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
 | 
				
			||||||
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
    Raises:
 | 
					            JSONWebKey.
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKey]
 | 
					        Response[Union[GenericError, JSONWebKey]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -206,17 +214,17 @@ json_body=json_body,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    kid: str,
 | 
					    kid: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKey,
 | 
					    json_body: JSONWebKey,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKey]:
 | 
					) -> Optional[Union[GenericError, JSONWebKey]]:
 | 
				
			||||||
    """Set JSON Web Key
 | 
					    """Update a JSON Web Key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
    own.
 | 
					    own.
 | 
				
			||||||
| 
						 | 
					@ -230,14 +238,12 @@ async def asyncio(
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        kid (str):
 | 
					        kid (str):
 | 
				
			||||||
        json_body (JsonWebKey):
 | 
					        json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
 | 
				
			||||||
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
    Raises:
 | 
					            JSONWebKey.
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKey]
 | 
					        Response[Union[GenericError, JSONWebKey]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,14 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
from ...types import Response, UNSET
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from typing import cast
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
from typing import Dict
 | 
					from typing import Dict
 | 
				
			||||||
from ...models.json_web_key_set import JsonWebKeySet
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.json_web_key_set import JSONWebKeySet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,10 +16,10 @@ def _get_kwargs(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKeySet,
 | 
					    json_body: JSONWebKeySet,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
    url = "{}/admin/keys/{set}".format(
 | 
					    url = "{}/keys/{set}".format(
 | 
				
			||||||
        _client.base_url,set=set_)
 | 
					        _client.base_url,set=set_)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
| 
						 | 
					@ -48,25 +47,40 @@ def _get_kwargs(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
        response_200 = JsonWebKeySet.from_dict(response.json())
 | 
					        response_200 = JSONWebKeySet.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response_200
 | 
					        return response_200
 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					    if response.status_code == HTTPStatus.UNAUTHORIZED:
 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					        response_401 = GenericError.from_dict(response.json())
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
 | 
					
 | 
				
			||||||
 | 
					        return response_401
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.FORBIDDEN:
 | 
				
			||||||
 | 
					        response_403 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_403
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    return Response(
 | 
					    return Response(
 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					        status_code=response.status_code,
 | 
				
			||||||
        content=response.content,
 | 
					        content=response.content,
 | 
				
			||||||
        headers=response.headers,
 | 
					        headers=response.headers,
 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,9 +88,9 @@ def sync_detailed(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKeySet,
 | 
					    json_body: JSONWebKeySet,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Update a JSON Web Key Set
 | 
					    """Update a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
| 
						 | 
					@ -90,14 +104,15 @@ def sync_detailed(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (JsonWebKeySet): JSON Web Key Set
 | 
					        json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
 | 
				
			||||||
 | 
					            for
 | 
				
			||||||
    Raises:
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					            JSONWebKeySet. Since one with the same name is previously defined as
 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					            client.Client.JSONWebKeys and this one is last, this one will be
 | 
				
			||||||
 | 
					            effectively written in the swagger spec.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,15 +128,15 @@ json_body=json_body,
 | 
				
			||||||
        **kwargs,
 | 
					        **kwargs,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def sync(
 | 
					def sync(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKeySet,
 | 
					    json_body: JSONWebKeySet,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Update a JSON Web Key Set
 | 
					    """Update a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
| 
						 | 
					@ -135,14 +150,15 @@ def sync(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (JsonWebKeySet): JSON Web Key Set
 | 
					        json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
 | 
				
			||||||
 | 
					            for
 | 
				
			||||||
    Raises:
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					            JSONWebKeySet. Since one with the same name is previously defined as
 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					            client.Client.JSONWebKeys and this one is last, this one will be
 | 
				
			||||||
 | 
					            effectively written in the swagger spec.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -157,9 +173,9 @@ async def asyncio_detailed(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKeySet,
 | 
					    json_body: JSONWebKeySet,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					) -> Response[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Update a JSON Web Key Set
 | 
					    """Update a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
| 
						 | 
					@ -173,14 +189,15 @@ async def asyncio_detailed(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (JsonWebKeySet): JSON Web Key Set
 | 
					        json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
 | 
				
			||||||
 | 
					            for
 | 
				
			||||||
    Raises:
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					            JSONWebKeySet. Since one with the same name is previously defined as
 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					            client.Client.JSONWebKeys and this one is last, this one will be
 | 
				
			||||||
 | 
					            effectively written in the swagger spec.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -196,15 +213,15 @@ json_body=json_body,
 | 
				
			||||||
            **kwargs
 | 
					            **kwargs
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async def asyncio(
 | 
					async def asyncio(
 | 
				
			||||||
    set_: str,
 | 
					    set_: str,
 | 
				
			||||||
    *,
 | 
					    *,
 | 
				
			||||||
    _client: Client,
 | 
					    _client: Client,
 | 
				
			||||||
    json_body: JsonWebKeySet,
 | 
					    json_body: JSONWebKeySet,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					) -> Optional[Union[GenericError, JSONWebKeySet]]:
 | 
				
			||||||
    """Update a JSON Web Key Set
 | 
					    """Update a JSON Web Key Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
					     Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
 | 
				
			||||||
| 
						 | 
					@ -218,14 +235,15 @@ async def asyncio(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
        set_ (str):
 | 
					        set_ (str):
 | 
				
			||||||
        json_body (JsonWebKeySet): JSON Web Key Set
 | 
					        json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
 | 
				
			||||||
 | 
					            for
 | 
				
			||||||
    Raises:
 | 
					            "swagger generate spec" to generate only on definition of a
 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					            JSONWebKeySet. Since one with the same name is previously defined as
 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					            client.Client.JSONWebKeys and this one is last, this one will be
 | 
				
			||||||
 | 
					            effectively written in the swagger spec.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Returns:
 | 
					    Returns:
 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					        Response[Union[GenericError, JSONWebKeySet]]
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,224 @@
 | 
				
			||||||
 | 
					from typing import Any, Dict, List, Optional, Union, cast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...client import AuthenticatedClient, Client
 | 
				
			||||||
 | 
					from ...types import Response, UNSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ...models.generic_error import GenericError
 | 
				
			||||||
 | 
					from typing import cast
 | 
				
			||||||
 | 
					from ...models.o_auth_2_client import OAuth2Client
 | 
				
			||||||
 | 
					from typing import Dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _get_kwargs(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Dict[str, Any]:
 | 
				
			||||||
 | 
					    url = "{}/clients/{id}".format(
 | 
				
			||||||
 | 
					        _client.base_url,id=id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers: Dict[str, str] = _client.get_headers()
 | 
				
			||||||
 | 
					    cookies: Dict[str, Any] = _client.get_cookies()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    json_json_body = json_body.to_dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
						    "method": "put",
 | 
				
			||||||
 | 
					        "url": url,
 | 
				
			||||||
 | 
					        "headers": headers,
 | 
				
			||||||
 | 
					        "cookies": cookies,
 | 
				
			||||||
 | 
					        "timeout": _client.get_timeout(),
 | 
				
			||||||
 | 
					        "json": json_json_body,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.OK:
 | 
				
			||||||
 | 
					        response_200 = OAuth2Client.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_200
 | 
				
			||||||
 | 
					    if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
 | 
				
			||||||
 | 
					        response_500 = GenericError.from_dict(response.json())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return response_500
 | 
				
			||||||
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    return Response(
 | 
				
			||||||
 | 
					        status_code=response.status_code,
 | 
				
			||||||
 | 
					        content=response.content,
 | 
				
			||||||
 | 
					        headers=response.headers,
 | 
				
			||||||
 | 
					        parsed=_parse_response(response=response),
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Update an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
 | 
				
			||||||
 | 
					    returned via the API. This is the only time you will be able to retrieve the client secret, so write
 | 
				
			||||||
 | 
					    it down and keep it safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response = httpx.request(
 | 
				
			||||||
 | 
					        verify=_client.verify_ssl,
 | 
				
			||||||
 | 
					        **kwargs,
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def sync(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Update an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
 | 
				
			||||||
 | 
					    returned via the API. This is the only time you will be able to retrieve the client secret, so write
 | 
				
			||||||
 | 
					    it down and keep it safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sync_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio_detailed(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Response[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Update an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
 | 
				
			||||||
 | 
					    returned via the API. This is the only time you will be able to retrieve the client secret, so write
 | 
				
			||||||
 | 
					    it down and keep it safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kwargs = _get_kwargs(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
				
			||||||
 | 
					        response = await __client.request(
 | 
				
			||||||
 | 
					            **kwargs
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return _build_response(response=response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async def asyncio(
 | 
				
			||||||
 | 
					    id: str,
 | 
				
			||||||
 | 
					    *,
 | 
				
			||||||
 | 
					    _client: Client,
 | 
				
			||||||
 | 
					    json_body: OAuth2Client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					) -> Optional[Union[GenericError, OAuth2Client]]:
 | 
				
			||||||
 | 
					    """Update an OAuth 2.0 Client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
 | 
				
			||||||
 | 
					    returned via the API. This is the only time you will be able to retrieve the client secret, so write
 | 
				
			||||||
 | 
					    it down and keep it safe.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
				
			||||||
 | 
					    are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
				
			||||||
 | 
					    To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
 | 
				
			||||||
 | 
					    protected and only callable by first-party components.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Args:
 | 
				
			||||||
 | 
					        id (str):
 | 
				
			||||||
 | 
					        json_body (OAuth2Client):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns:
 | 
				
			||||||
 | 
					        Response[Union[GenericError, OAuth2Client]]
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (await asyncio_detailed(
 | 
				
			||||||
 | 
					        id=id,
 | 
				
			||||||
 | 
					_client=_client,
 | 
				
			||||||
 | 
					json_body=json_body,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    )).parsed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,156 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/keys/{set}/{kid}".format(
 | 
					 | 
				
			||||||
        _client.base_url,set=set_,kid=kid)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete a single JSON Web Key.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
					 | 
				
			||||||
    cryptographic key. A
 | 
					 | 
				
			||||||
    JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its
 | 
					 | 
				
			||||||
    set and key id. ORY Hydra uses
 | 
					 | 
				
			||||||
    this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID
 | 
					 | 
				
			||||||
    Connect ID tokens),
 | 
					 | 
				
			||||||
    and allows storing user-defined keys as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete a single JSON Web Key.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
					 | 
				
			||||||
    cryptographic key. A
 | 
					 | 
				
			||||||
    JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its
 | 
					 | 
				
			||||||
    set and key id. ORY Hydra uses
 | 
					 | 
				
			||||||
    this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID
 | 
					 | 
				
			||||||
    Connect ID tokens),
 | 
					 | 
				
			||||||
    and allows storing user-defined keys as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,145 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/keys/{set}".format(
 | 
					 | 
				
			||||||
        _client.base_url,set=set_)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete JSON Web Key Set
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
					 | 
				
			||||||
    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
					 | 
				
			||||||
    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
					 | 
				
			||||||
    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
					 | 
				
			||||||
    keys as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete JSON Web Key Set
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
 | 
					 | 
				
			||||||
    cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
 | 
					 | 
				
			||||||
    is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
 | 
					 | 
				
			||||||
    used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
 | 
					 | 
				
			||||||
    keys as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,211 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.json_web_key_set import JsonWebKeySet
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/keys/{set}/{kid}".format(
 | 
					 | 
				
			||||||
        _client.base_url,set=set_,kid=kid)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = JsonWebKeySet.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    """Get JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
 | 
					 | 
				
			||||||
    the specific key ID (kid).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    """Get JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
 | 
					 | 
				
			||||||
    the specific key ID (kid).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    """Get JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
 | 
					 | 
				
			||||||
    the specific key ID (kid).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    set_: str,
 | 
					 | 
				
			||||||
    kid: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[JsonWebKeySet]:
 | 
					 | 
				
			||||||
    """Get JSON Web Key
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
 | 
					 | 
				
			||||||
    the specific key ID (kid).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        set_ (str):
 | 
					 | 
				
			||||||
        kid (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[JsonWebKeySet]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        set_=set_,
 | 
					 | 
				
			||||||
kid=kid,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,212 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.is_ready_response_200 import IsReadyResponse200
 | 
					 | 
				
			||||||
from ...models.is_ready_response_503 import IsReadyResponse503
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/health/ready".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = IsReadyResponse200.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
 | 
					 | 
				
			||||||
        response_503 = IsReadyResponse503.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_503
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    """Check HTTP Server and Database Status
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
 | 
					 | 
				
			||||||
    dependencies (e.g.
 | 
					 | 
				
			||||||
    the database) are responsive as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
 | 
					 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[IsReadyResponse200, IsReadyResponse503]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    """Check HTTP Server and Database Status
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
 | 
					 | 
				
			||||||
    dependencies (e.g.
 | 
					 | 
				
			||||||
    the database) are responsive as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
 | 
					 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[IsReadyResponse200, IsReadyResponse503]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    """Check HTTP Server and Database Status
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
 | 
					 | 
				
			||||||
    dependencies (e.g.
 | 
					 | 
				
			||||||
    the database) are responsive as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
 | 
					 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[IsReadyResponse200, IsReadyResponse503]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
 | 
					 | 
				
			||||||
    """Check HTTP Server and Database Status
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
 | 
					 | 
				
			||||||
    dependencies (e.g.
 | 
					 | 
				
			||||||
    the database) are responsive as well.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If the service supports TLS Edge Termination, this endpoint does not require the
 | 
					 | 
				
			||||||
    `X-Forwarded-Proto` header to be set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
 | 
					 | 
				
			||||||
    refer to the cluster state, only to a single instance.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[IsReadyResponse200, IsReadyResponse503]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,278 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.handled_login_request_is_the_request_payload_used_to_accept_a_login_request import HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/login/accept".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["login_challenge"] = login_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has successfully authenticated and includes additional
 | 
					 | 
				
			||||||
    information such as
 | 
					 | 
				
			||||||
    the subject's ID and if Ory should remember the subject's subject agent for future authentication
 | 
					 | 
				
			||||||
    attempts by setting
 | 
					 | 
				
			||||||
    a cookie.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
        json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has successfully authenticated and includes additional
 | 
					 | 
				
			||||||
    information such as
 | 
					 | 
				
			||||||
    the subject's ID and if Ory should remember the subject's subject agent for future authentication
 | 
					 | 
				
			||||||
    attempts by setting
 | 
					 | 
				
			||||||
    a cookie.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
        json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has successfully authenticated and includes additional
 | 
					 | 
				
			||||||
    information such as
 | 
					 | 
				
			||||||
    the subject's ID and if Ory should remember the subject's subject agent for future authentication
 | 
					 | 
				
			||||||
    attempts by setting
 | 
					 | 
				
			||||||
    a cookie.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
        json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has successfully authenticated and includes additional
 | 
					 | 
				
			||||||
    information such as
 | 
					 | 
				
			||||||
    the subject's ID and if Ory should remember the subject's subject agent for future authentication
 | 
					 | 
				
			||||||
    attempts by setting
 | 
					 | 
				
			||||||
    a cookie.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the login provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
        json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,213 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/logout/accept".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["logout_challenge"] = logout_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to confirm that logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to confirm that logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to confirm that logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Accept OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to confirm that logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,220 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.CREATED:
 | 
					 | 
				
			||||||
        response_201 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_201
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
					 | 
				
			||||||
        response_400 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_400
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Create OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
 | 
					 | 
				
			||||||
    secret
 | 
					 | 
				
			||||||
    is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Create OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
 | 
					 | 
				
			||||||
    secret
 | 
					 | 
				
			||||||
    is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Create OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
 | 
					 | 
				
			||||||
    secret
 | 
					 | 
				
			||||||
    is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Create OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
 | 
					 | 
				
			||||||
    secret
 | 
					 | 
				
			||||||
    is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,145 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Delete an existing OAuth 2.0 Client by its ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Make sure that this endpoint is well protected and only callable by first-party components.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Delete an existing OAuth 2.0 Client by its ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Make sure that this endpoint is well protected and only callable by first-party components.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,140 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    client_id: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/tokens".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["client_id"] = client_id
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    client_id: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        client_id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
client_id=client_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    client_id: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        client_id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
client_id=client_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,145 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/trust/grants/jwt-bearer/issuers/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when
 | 
					 | 
				
			||||||
    you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT)
 | 
					 | 
				
			||||||
    Profile
 | 
					 | 
				
			||||||
    for OAuth 2.0 Client Authentication and Authorization Grant.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when
 | 
					 | 
				
			||||||
    you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT)
 | 
					 | 
				
			||||||
    Profile
 | 
					 | 
				
			||||||
    for OAuth 2.0 Client Authentication and Authorization Grant.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,210 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get an OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get an OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get an OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get an OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,268 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from ...models.contains_information_on_an_ongoing_consent_request import ContainsInformationOnAnOngoingConsentRequest
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/consent".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["consent_challenge"] = consent_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = ContainsInformationOnAnOngoingConsentRequest.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.GONE:
 | 
					 | 
				
			||||||
        response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_410
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,256 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.contains_information_on_an_ongoing_login_request import ContainsInformationOnAnOngoingLoginRequest
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/login".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["login_challenge"] = login_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = ContainsInformationOnAnOngoingLoginRequest.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.GONE:
 | 
					 | 
				
			||||||
        response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_410
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Per default, the login provider is Ory itself. You may use a different login provider which needs to
 | 
					 | 
				
			||||||
    be a web-app
 | 
					 | 
				
			||||||
    you write and host, and it must be able to authenticate (\"show the subject a login screen\")
 | 
					 | 
				
			||||||
    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Per default, the login provider is Ory itself. You may use a different login provider which needs to
 | 
					 | 
				
			||||||
    be a web-app
 | 
					 | 
				
			||||||
    you write and host, and it must be able to authenticate (\"show the subject a login screen\")
 | 
					 | 
				
			||||||
    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Per default, the login provider is Ory itself. You may use a different login provider which needs to
 | 
					 | 
				
			||||||
    be a web-app
 | 
					 | 
				
			||||||
    you write and host, and it must be able to authenticate (\"show the subject a login screen\")
 | 
					 | 
				
			||||||
    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    login_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Login Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell the Ory OAuth2 Service about it.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Per default, the login provider is Ory itself. You may use a different login provider which needs to
 | 
					 | 
				
			||||||
    be a web-app
 | 
					 | 
				
			||||||
    you write and host, and it must be able to authenticate (\"show the subject a login screen\")
 | 
					 | 
				
			||||||
    a subject (in OAuth2 the proper name for subject is \"resource owner\").
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The authentication challenge is appended to the login provider URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The login
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
 | 
					 | 
				
			||||||
    the requested authentication process.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        login_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
login_challenge=login_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,208 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.contains_information_about_an_ongoing_logout_request import ContainsInformationAboutAnOngoingLogoutRequest
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/logout".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["logout_challenge"] = logout_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = ContainsInformationAboutAnOngoingLogoutRequest.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.GONE:
 | 
					 | 
				
			||||||
        response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_410
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to fetch an Ory OAuth 2.0 logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to fetch an Ory OAuth 2.0 logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to fetch an Ory OAuth 2.0 logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
 | 
					 | 
				
			||||||
    """Get OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to fetch an Ory OAuth 2.0 logout request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,198 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/trust/grants/jwt-bearer/issuers/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = TrustedOAuth2JwtGrantIssuer.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Get Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Get Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Get Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Get Trusted OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
 | 
					 | 
				
			||||||
    created the trust relationship.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,200 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.introspected_o_auth_2_token import IntrospectedOAuth2Token
 | 
					 | 
				
			||||||
from ...models.introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    form_data: IntrospectOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/introspect".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "data": form_data.to_dict(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = IntrospectedOAuth2Token.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    form_data: IntrospectOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    """Introspect OAuth2 Access and Refresh Tokens
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
					 | 
				
			||||||
    active token
 | 
					 | 
				
			||||||
    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
					 | 
				
			||||||
    included. You can
 | 
					 | 
				
			||||||
    set additional data for a token by setting `session.access_token` during the consent flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[IntrospectedOAuth2Token]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    form_data: IntrospectOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    """Introspect OAuth2 Access and Refresh Tokens
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
					 | 
				
			||||||
    active token
 | 
					 | 
				
			||||||
    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
					 | 
				
			||||||
    included. You can
 | 
					 | 
				
			||||||
    set additional data for a token by setting `session.access_token` during the consent flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[IntrospectedOAuth2Token]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    form_data: IntrospectOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    """Introspect OAuth2 Access and Refresh Tokens
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
					 | 
				
			||||||
    active token
 | 
					 | 
				
			||||||
    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
					 | 
				
			||||||
    included. You can
 | 
					 | 
				
			||||||
    set additional data for a token by setting `session.access_token` during the consent flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[IntrospectedOAuth2Token]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    form_data: IntrospectOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[IntrospectedOAuth2Token]:
 | 
					 | 
				
			||||||
    """Introspect OAuth2 Access and Refresh Tokens
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
 | 
					 | 
				
			||||||
    active token
 | 
					 | 
				
			||||||
    is neither expired nor revoked. If a token is active, additional information on the token will be
 | 
					 | 
				
			||||||
    included. You can
 | 
					 | 
				
			||||||
    set additional data for a token by setting `session.access_token` during the consent flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[IntrospectedOAuth2Token]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,177 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...types import UNSET, Unset
 | 
					 | 
				
			||||||
from ...models import OAuth20Client
 | 
					 | 
				
			||||||
from typing import Optional
 | 
					 | 
				
			||||||
from typing import Union
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    client_name: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    owner: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["page_size"] = page_size
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["page_token"] = page_token
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["client_name"] = client_name
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["owner"] = owner
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List[OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = list([ OAuth20Client.from_dict(data) for data in response.json() ])
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[List[OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    client_name: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    owner: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List[OAuth20Client]]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Clients
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all clients in the database, and never returns client secrets.
 | 
					 | 
				
			||||||
    As a default it lists the first 100 clients.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        client_name (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
        owner (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
client_name=client_name,
 | 
					 | 
				
			||||||
owner=owner,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    client_name: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    owner: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List[OAuth20Client]]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Clients
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all clients in the database, and never returns client secrets.
 | 
					 | 
				
			||||||
    As a default it lists the first 100 clients.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        client_name (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
        owner (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
client_name=client_name,
 | 
					 | 
				
			||||||
owner=owner,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,266 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...types import UNSET, Unset
 | 
					 | 
				
			||||||
from typing import Optional
 | 
					 | 
				
			||||||
from typing import Union
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.o_auth_20_consent_session import OAuth20ConsentSession
 | 
					 | 
				
			||||||
from typing import cast, List
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    login_session_id: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/sessions/consent".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["page_size"] = page_size
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["page_token"] = page_token
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["subject"] = subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["login_session_id"] = login_session_id
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = []
 | 
					 | 
				
			||||||
        _response_200 = response.json()
 | 
					 | 
				
			||||||
        for componentsschemaso_auth_2_consent_sessions_item_data in (_response_200):
 | 
					 | 
				
			||||||
            componentsschemaso_auth_2_consent_sessions_item = OAuth20ConsentSession.from_dict(componentsschemaso_auth_2_consent_sessions_item_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            response_200.append(componentsschemaso_auth_2_consent_sessions_item)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    login_session_id: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
					 | 
				
			||||||
    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
					 | 
				
			||||||
    empty JSON array with status code 200 OK.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        login_session_id (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['OAuth20ConsentSession']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
login_session_id=login_session_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    login_session_id: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
					 | 
				
			||||||
    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
					 | 
				
			||||||
    empty JSON array with status code 200 OK.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        login_session_id (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['OAuth20ConsentSession']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
login_session_id=login_session_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    login_session_id: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
					 | 
				
			||||||
    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
					 | 
				
			||||||
    empty JSON array with status code 200 OK.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        login_session_id (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['OAuth20ConsentSession']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
login_session_id=login_session_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    page_size: Union[Unset, None, int] = 250,
 | 
					 | 
				
			||||||
    page_token: Union[Unset, None, str] = '1',
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    login_session_id: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[List['OAuth20ConsentSession']]:
 | 
					 | 
				
			||||||
    """List OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint lists all subject's granted consent sessions, including client and granted scope.
 | 
					 | 
				
			||||||
    If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
 | 
					 | 
				
			||||||
    empty JSON array with status code 200 OK.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        page_size (Union[Unset, None, int]):  Default: 250.
 | 
					 | 
				
			||||||
        page_token (Union[Unset, None, str]):  Default: '1'.
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        login_session_id (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['OAuth20ConsentSession']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
page_size=page_size,
 | 
					 | 
				
			||||||
page_token=page_token,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
login_session_id=login_session_id,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,242 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...types import UNSET, Unset
 | 
					 | 
				
			||||||
from typing import Optional
 | 
					 | 
				
			||||||
from typing import Union
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast, List
 | 
					 | 
				
			||||||
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    max_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    default_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    issuer: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/trust/grants/jwt-bearer/issuers".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["MaxItems"] = max_items
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["DefaultItems"] = default_items
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["issuer"] = issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = []
 | 
					 | 
				
			||||||
        _response_200 = response.json()
 | 
					 | 
				
			||||||
        for componentsschemastrusted_o_auth_2_jwt_grant_issuers_item_data in (_response_200):
 | 
					 | 
				
			||||||
            componentsschemastrusted_o_auth_2_jwt_grant_issuers_item = TrustedOAuth2JwtGrantIssuer.from_dict(componentsschemastrusted_o_auth_2_jwt_grant_issuers_item_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            response_200.append(componentsschemastrusted_o_auth_2_jwt_grant_issuers_item)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    max_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    default_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    issuer: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    """List Trusted OAuth2 JWT Bearer Grant Type Issuers
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        max_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        default_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        issuer (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['TrustedOAuth2JwtGrantIssuer']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
max_items=max_items,
 | 
					 | 
				
			||||||
default_items=default_items,
 | 
					 | 
				
			||||||
issuer=issuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    max_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    default_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    issuer: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    """List Trusted OAuth2 JWT Bearer Grant Type Issuers
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        max_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        default_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        issuer (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['TrustedOAuth2JwtGrantIssuer']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
max_items=max_items,
 | 
					 | 
				
			||||||
default_items=default_items,
 | 
					 | 
				
			||||||
issuer=issuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    max_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    default_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    issuer: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    """List Trusted OAuth2 JWT Bearer Grant Type Issuers
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        max_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        default_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        issuer (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['TrustedOAuth2JwtGrantIssuer']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
max_items=max_items,
 | 
					 | 
				
			||||||
default_items=default_items,
 | 
					 | 
				
			||||||
issuer=issuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    max_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    default_items: Union[Unset, None, int] = UNSET,
 | 
					 | 
				
			||||||
    issuer: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
 | 
					 | 
				
			||||||
    """List Trusted OAuth2 JWT Bearer Grant Type Issuers
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        max_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        default_items (Union[Unset, None, int]):
 | 
					 | 
				
			||||||
        issuer (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[List['TrustedOAuth2JwtGrantIssuer']]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
max_items=max_items,
 | 
					 | 
				
			||||||
default_items=default_items,
 | 
					 | 
				
			||||||
issuer=issuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,128 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/auth".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.FOUND:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """OAuth 2.0 Authorize Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries at https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """OAuth 2.0 Authorize Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries at https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,200 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.o_auth_2_token_exchange import OAuth2TokenExchange
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.oauth_2_token_exchange_data import Oauth2TokenExchangeData
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: Oauth2TokenExchangeData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/token".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "data": form_data.to_dict(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth2TokenExchange.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: Oauth2TokenExchangeData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    """The OAuth 2.0 Token Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries here
 | 
					 | 
				
			||||||
    https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth2TokenExchange]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: Oauth2TokenExchangeData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    """The OAuth 2.0 Token Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries here
 | 
					 | 
				
			||||||
    https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth2TokenExchange]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: Oauth2TokenExchangeData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    """The OAuth 2.0 Token Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries here
 | 
					 | 
				
			||||||
    https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth2TokenExchange]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: Oauth2TokenExchangeData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth2TokenExchange]:
 | 
					 | 
				
			||||||
    """The OAuth 2.0 Token Endpoint
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use open source libraries to perform OAuth 2.0 and OpenID Connect
 | 
					 | 
				
			||||||
    available for any programming language. You can find a list of libraries here
 | 
					 | 
				
			||||||
    https://oauth.net/code/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The Ory SDK is not yet able to this endpoint properly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth2TokenExchange]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,246 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.json_patch import JsonPatch
 | 
					 | 
				
			||||||
from typing import cast, List
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: List['JsonPatch'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = []
 | 
					 | 
				
			||||||
    for componentsschemasjson_patch_document_item_data in json_body:
 | 
					 | 
				
			||||||
        componentsschemasjson_patch_document_item = componentsschemasjson_patch_document_item_data.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        json_json_body.append(componentsschemasjson_patch_document_item)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "patch",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
					 | 
				
			||||||
        response_404 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_404
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: List['JsonPatch'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Patch OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
 | 
					 | 
				
			||||||
    the secret will be updated and returned via the API. This is the
 | 
					 | 
				
			||||||
    only time you will be able to retrieve the client secret, so write it down and keep it safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (List['JsonPatch']): A JSONPatchDocument request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: List['JsonPatch'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Patch OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
 | 
					 | 
				
			||||||
    the secret will be updated and returned via the API. This is the
 | 
					 | 
				
			||||||
    only time you will be able to retrieve the client secret, so write it down and keep it safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (List['JsonPatch']): A JSONPatchDocument request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: List['JsonPatch'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Patch OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
 | 
					 | 
				
			||||||
    the secret will be updated and returned via the API. This is the
 | 
					 | 
				
			||||||
    only time you will be able to retrieve the client secret, so write it down and keep it safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (List['JsonPatch']): A JSONPatchDocument request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: List['JsonPatch'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Patch OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
 | 
					 | 
				
			||||||
    the secret will be updated and returned via the API. This is the
 | 
					 | 
				
			||||||
    only time you will be able to retrieve the client secret, so write it down and keep it safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (List['JsonPatch']): A JSONPatchDocument request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,302 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.the_request_payload_used_to_accept_a_login_or_consent_request import TheRequestPayloadUsedToAcceptALoginOrConsentRequest
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/consent/reject".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["consent_challenge"] = consent_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
 | 
					 | 
				
			||||||
    on his/her behalf.
 | 
					 | 
				
			||||||
    The consent provider must include a reason why the consent was not granted.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
 | 
					 | 
				
			||||||
    on his/her behalf.
 | 
					 | 
				
			||||||
    The consent provider must include a reason why the consent was not granted.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
 | 
					 | 
				
			||||||
    on his/her behalf.
 | 
					 | 
				
			||||||
    The consent provider must include a reason why the consent was not granted.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
 | 
					 | 
				
			||||||
    consent_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20RedirectBrowserTo]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Consent Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
 | 
					 | 
				
			||||||
    provider
 | 
					 | 
				
			||||||
    to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
 | 
					 | 
				
			||||||
    must now be asked if
 | 
					 | 
				
			||||||
    the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
 | 
					 | 
				
			||||||
    subject's behalf.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The consent challenge is appended to the consent provider's URL to which the subject's user-agent
 | 
					 | 
				
			||||||
    (browser) is redirected to. The consent
 | 
					 | 
				
			||||||
    provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
 | 
					 | 
				
			||||||
    subject accepted
 | 
					 | 
				
			||||||
    or rejected the request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
 | 
					 | 
				
			||||||
    on his/her behalf.
 | 
					 | 
				
			||||||
    The consent provider must include a reason why the consent was not granted.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response contains a redirect URL which the consent provider should redirect the user-agent to.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The default consent provider is available via the Ory Managed Account Experience. To customize the
 | 
					 | 
				
			||||||
    consent provider, please
 | 
					 | 
				
			||||||
    head over to the OAuth 2.0 documentation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        consent_challenge (str):
 | 
					 | 
				
			||||||
        json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20RedirectBrowserTo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
consent_challenge=consent_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,148 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/requests/logout/reject".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["logout_challenge"] = logout_challenge
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to deny that logout request.
 | 
					 | 
				
			||||||
    No HTTP request body is required.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response is empty as the logout provider has to chose what action to perform next.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    logout_challenge: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Reject OAuth 2.0 Session Logout Request
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
 | 
					 | 
				
			||||||
    endpoint is used to deny that logout request.
 | 
					 | 
				
			||||||
    No HTTP request body is required.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The response is empty as the logout provider has to chose what action to perform next.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        logout_challenge (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
logout_challenge=logout_challenge,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,167 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...types import UNSET, Unset
 | 
					 | 
				
			||||||
from typing import Optional
 | 
					 | 
				
			||||||
from typing import Union
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    client: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    all_: Union[Unset, None, bool] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/sessions/consent".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["subject"] = subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["client"] = client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params["all"] = all_
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    client: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    all_: Union[Unset, None, bool] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revoke OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint revokes a subject's granted consent sessions and invalidates all
 | 
					 | 
				
			||||||
    associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0
 | 
					 | 
				
			||||||
    Client ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        client (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
        all_ (Union[Unset, None, bool]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
client=client,
 | 
					 | 
				
			||||||
all_=all_,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
    client: Union[Unset, None, str] = UNSET,
 | 
					 | 
				
			||||||
    all_: Union[Unset, None, bool] = UNSET,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revoke OAuth 2.0 Consent Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint revokes a subject's granted consent sessions and invalidates all
 | 
					 | 
				
			||||||
    associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0
 | 
					 | 
				
			||||||
    Client ID.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
        client (Union[Unset, None, str]):
 | 
					 | 
				
			||||||
        all_ (Union[Unset, None, bool]):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
client=client,
 | 
					 | 
				
			||||||
all_=all_,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,146 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/oauth2/auth/sessions/login".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params: Dict[str, Any] = {}
 | 
					 | 
				
			||||||
    params["subject"] = subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "params": params,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revokes All OAuth 2.0 Login Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
					 | 
				
			||||||
    session, the subject
 | 
					 | 
				
			||||||
    has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens and
 | 
					 | 
				
			||||||
    does not work with OpenID Connect Front- or Back-channel logout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    subject: str,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revokes All OAuth 2.0 Login Sessions of a Subject
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint invalidates a subject's authentication session. After revoking the authentication
 | 
					 | 
				
			||||||
    session, the subject
 | 
					 | 
				
			||||||
    has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens and
 | 
					 | 
				
			||||||
    does not work with OpenID Connect Front- or Back-channel logout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        subject (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
subject=subject,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,143 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.revoke_o_auth_2_token_data import RevokeOAuth2TokenData
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: RevokeOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/revoke".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "data": form_data.to_dict(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: RevokeOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revoke OAuth 2.0 Access or Refresh Token
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
 | 
					 | 
				
			||||||
    token can no
 | 
					 | 
				
			||||||
    longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
 | 
					 | 
				
			||||||
    an access token.
 | 
					 | 
				
			||||||
    Revoking a refresh token also invalidates the access token that was created with it. A token may
 | 
					 | 
				
			||||||
    only be revoked by
 | 
					 | 
				
			||||||
    the client the token was generated for.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    form_data: RevokeOAuth2TokenData,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Revoke OAuth 2.0 Access or Refresh Token
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
 | 
					 | 
				
			||||||
    token can no
 | 
					 | 
				
			||||||
    longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
 | 
					 | 
				
			||||||
    an access token.
 | 
					 | 
				
			||||||
    Revoking a refresh token also invalidates the access token that was created with it. A token may
 | 
					 | 
				
			||||||
    only be revoked by
 | 
					 | 
				
			||||||
    the client the token was generated for.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
form_data=form_data,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,260 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
					 | 
				
			||||||
        response_400 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_400
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
					 | 
				
			||||||
        response_404 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_404
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
 | 
					 | 
				
			||||||
    secret is used,
 | 
					 | 
				
			||||||
    otherwise the existing secret is used.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If set, the secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
 | 
					 | 
				
			||||||
    secret is used,
 | 
					 | 
				
			||||||
    otherwise the existing secret is used.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If set, the secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
 | 
					 | 
				
			||||||
    secret is used,
 | 
					 | 
				
			||||||
    otherwise the existing secret is used.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If set, the secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth 2.0 Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
 | 
					 | 
				
			||||||
    secret is used,
 | 
					 | 
				
			||||||
    otherwise the existing secret is used.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If set, the secret is echoed in the response. It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,219 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client_token_lifespans import OAuth20ClientTokenLifespans
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20ClientTokenLifespans,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/clients/{id}/lifespans".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20ClientTokenLifespans,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client Token Lifespans
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
 | 
					 | 
				
			||||||
    fields.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
 | 
					 | 
				
			||||||
            this OAuth 2.0 Client.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20ClientTokenLifespans,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client Token Lifespans
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
 | 
					 | 
				
			||||||
    fields.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
 | 
					 | 
				
			||||||
            this OAuth 2.0 Client.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20ClientTokenLifespans,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client Token Lifespans
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
 | 
					 | 
				
			||||||
    fields.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
 | 
					 | 
				
			||||||
            this OAuth 2.0 Client.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20ClientTokenLifespans,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client Token Lifespans
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
 | 
					 | 
				
			||||||
    fields.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
 | 
					 | 
				
			||||||
            this OAuth 2.0 Client.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,210 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.trust_o_auth_2_jwt_grant_issuer import TrustOAuth2JwtGrantIssuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TrustOAuth2JwtGrantIssuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/admin/trust/grants/jwt-bearer/issuers".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.CREATED:
 | 
					 | 
				
			||||||
        response_201 = TrustedOAuth2JwtGrantIssuer.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_201
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TrustOAuth2JwtGrantIssuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Trust OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to establish a trust relationship for a JWT issuer
 | 
					 | 
				
			||||||
    to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
 | 
					 | 
				
			||||||
    and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
 | 
					 | 
				
			||||||
            Body
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TrustOAuth2JwtGrantIssuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Trust OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to establish a trust relationship for a JWT issuer
 | 
					 | 
				
			||||||
    to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
 | 
					 | 
				
			||||||
    and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
 | 
					 | 
				
			||||||
            Body
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TrustOAuth2JwtGrantIssuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Trust OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to establish a trust relationship for a JWT issuer
 | 
					 | 
				
			||||||
    to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
 | 
					 | 
				
			||||||
    and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
 | 
					 | 
				
			||||||
            Body
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: TrustOAuth2JwtGrantIssuer,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
 | 
					 | 
				
			||||||
    """Trust OAuth2 JWT Bearer Grant Type Issuer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     Use this endpoint to establish a trust relationship for a JWT issuer
 | 
					 | 
				
			||||||
    to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
 | 
					 | 
				
			||||||
    and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
 | 
					 | 
				
			||||||
            Body
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[TrustedOAuth2JwtGrantIssuer]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,272 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/register".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "post",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.CREATED:
 | 
					 | 
				
			||||||
        response_201 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_201
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.BAD_REQUEST:
 | 
					 | 
				
			||||||
        response_400 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_400
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Register OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Please note that using this endpoint you are not able to choose the `client_secret` nor the
 | 
					 | 
				
			||||||
    `client_id` as those
 | 
					 | 
				
			||||||
    values will be server generated when specifying `token_endpoint_auth_method` as
 | 
					 | 
				
			||||||
    `client_secret_basic` or
 | 
					 | 
				
			||||||
    `client_secret_post`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The `client_secret` will be returned in the response and you will not be able to retrieve it later
 | 
					 | 
				
			||||||
    on.
 | 
					 | 
				
			||||||
    Write the secret down and keep it somewhere safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Register OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Please note that using this endpoint you are not able to choose the `client_secret` nor the
 | 
					 | 
				
			||||||
    `client_id` as those
 | 
					 | 
				
			||||||
    values will be server generated when specifying `token_endpoint_auth_method` as
 | 
					 | 
				
			||||||
    `client_secret_basic` or
 | 
					 | 
				
			||||||
    `client_secret_post`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The `client_secret` will be returned in the response and you will not be able to retrieve it later
 | 
					 | 
				
			||||||
    on.
 | 
					 | 
				
			||||||
    Write the secret down and keep it somewhere safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Register OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Please note that using this endpoint you are not able to choose the `client_secret` nor the
 | 
					 | 
				
			||||||
    `client_id` as those
 | 
					 | 
				
			||||||
    values will be server generated when specifying `token_endpoint_auth_method` as
 | 
					 | 
				
			||||||
    `client_secret_basic` or
 | 
					 | 
				
			||||||
    `client_secret_post`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The `client_secret` will be returned in the response and you will not be able to retrieve it later
 | 
					 | 
				
			||||||
    on.
 | 
					 | 
				
			||||||
    Write the secret down and keep it somewhere safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Register OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Please note that using this endpoint you are not able to choose the `client_secret` nor the
 | 
					 | 
				
			||||||
    `client_id` as those
 | 
					 | 
				
			||||||
    values will be server generated when specifying `token_endpoint_auth_method` as
 | 
					 | 
				
			||||||
    `client_secret_basic` or
 | 
					 | 
				
			||||||
    `client_secret_post`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    The `client_secret` will be returned in the response and you will not be able to retrieve it later
 | 
					 | 
				
			||||||
    on.
 | 
					 | 
				
			||||||
    Write the secret down and keep it somewhere safe.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,165 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/register/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "delete",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NO_CONTENT:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
 | 
					 | 
				
			||||||
    endpoint
 | 
					 | 
				
			||||||
    is disabled by default. It can be enabled by an administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,193 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.open_id_connect_discovery_metadata import OpenIDConnectDiscoveryMetadata
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/.well-known/openid-configuration".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OpenIDConnectDiscoveryMetadata.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    """OpenID Connect Discovery
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
 | 
					 | 
				
			||||||
    obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
 | 
					 | 
				
			||||||
    and others.
 | 
					 | 
				
			||||||
    For a full list of clients go here: https://openid.net/developers/certified/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OpenIDConnectDiscoveryMetadata]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    """OpenID Connect Discovery
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
 | 
					 | 
				
			||||||
    obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
 | 
					 | 
				
			||||||
    and others.
 | 
					 | 
				
			||||||
    For a full list of clients go here: https://openid.net/developers/certified/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OpenIDConnectDiscoveryMetadata]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    """OpenID Connect Discovery
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
 | 
					 | 
				
			||||||
    obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
 | 
					 | 
				
			||||||
    and others.
 | 
					 | 
				
			||||||
    For a full list of clients go here: https://openid.net/developers/certified/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OpenIDConnectDiscoveryMetadata]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OpenIDConnectDiscoveryMetadata]:
 | 
					 | 
				
			||||||
    """OpenID Connect Discovery
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
 | 
					 | 
				
			||||||
    obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
 | 
					 | 
				
			||||||
    and others.
 | 
					 | 
				
			||||||
    For a full list of clients go here: https://openid.net/developers/certified/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OpenIDConnectDiscoveryMetadata]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,234 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/register/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OAuth20Client]:
 | 
					 | 
				
			||||||
    """Get OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly and can be used in self-service. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OAuth20Client]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,197 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...models.oidc_user_info import OidcUserInfo
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/userinfo".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OidcUserInfo]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OidcUserInfo.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[OidcUserInfo]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OidcUserInfo]:
 | 
					 | 
				
			||||||
    """OpenID Connect Userinfo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns the payload of the ID Token, including `session.id_token` values, of
 | 
					 | 
				
			||||||
    the provided OAuth 2.0 Access Token's consent request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    In the case of authentication error, a WWW-Authenticate header might be set in the response
 | 
					 | 
				
			||||||
    with more information about the error. See [the
 | 
					 | 
				
			||||||
    spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
 | 
					 | 
				
			||||||
    for more details about header format.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OidcUserInfo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OidcUserInfo]:
 | 
					 | 
				
			||||||
    """OpenID Connect Userinfo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns the payload of the ID Token, including `session.id_token` values, of
 | 
					 | 
				
			||||||
    the provided OAuth 2.0 Access Token's consent request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    In the case of authentication error, a WWW-Authenticate header might be set in the response
 | 
					 | 
				
			||||||
    with more information about the error. See [the
 | 
					 | 
				
			||||||
    spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
 | 
					 | 
				
			||||||
    for more details about header format.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OidcUserInfo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[OidcUserInfo]:
 | 
					 | 
				
			||||||
    """OpenID Connect Userinfo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns the payload of the ID Token, including `session.id_token` values, of
 | 
					 | 
				
			||||||
    the provided OAuth 2.0 Access Token's consent request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    In the case of authentication error, a WWW-Authenticate header might be set in the response
 | 
					 | 
				
			||||||
    with more information about the error. See [the
 | 
					 | 
				
			||||||
    spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
 | 
					 | 
				
			||||||
    for more details about header format.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OidcUserInfo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[OidcUserInfo]:
 | 
					 | 
				
			||||||
    """OpenID Connect Userinfo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint returns the payload of the ID Token, including `session.id_token` values, of
 | 
					 | 
				
			||||||
    the provided OAuth 2.0 Access Token's consent request.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    In the case of authentication error, a WWW-Authenticate header might be set in the response
 | 
					 | 
				
			||||||
    with more information about the error. See [the
 | 
					 | 
				
			||||||
    spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
 | 
					 | 
				
			||||||
    for more details about header format.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[OidcUserInfo]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,134 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/sessions/logout".format(
 | 
					 | 
				
			||||||
        _client.base_url)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "get",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.FOUND:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """OpenID Connect Front- and Back-channel Enabled Logout
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint initiates and completes user logout at the Ory OAuth2 & OpenID provider and initiates
 | 
					 | 
				
			||||||
    OpenID Connect Front- / Back-channel logout:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    https://openid.net/specs/openid-connect-frontchannel-1_0.html
 | 
					 | 
				
			||||||
    https://openid.net/specs/openid-connect-backchannel-1_0.html
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Back-channel logout is performed asynchronously and does not affect logout flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Any]:
 | 
					 | 
				
			||||||
    """OpenID Connect Front- and Back-channel Enabled Logout
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint initiates and completes user logout at the Ory OAuth2 & OpenID provider and initiates
 | 
					 | 
				
			||||||
    OpenID Connect Front- / Back-channel logout:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    https://openid.net/specs/openid-connect-frontchannel-1_0.html
 | 
					 | 
				
			||||||
    https://openid.net/specs/openid-connect-backchannel-1_0.html
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Back-channel logout is performed asynchronously and does not affect logout flow.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Any]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        _client=_client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,305 +0,0 @@
 | 
				
			||||||
from http import HTTPStatus
 | 
					 | 
				
			||||||
from typing import Any, Dict, List, Optional, Union, cast
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import httpx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ...client import AuthenticatedClient, Client
 | 
					 | 
				
			||||||
from ...types import Response, UNSET
 | 
					 | 
				
			||||||
from ... import errors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from typing import Dict
 | 
					 | 
				
			||||||
from typing import cast
 | 
					 | 
				
			||||||
from ...models.o_auth_20_client import OAuth20Client
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _get_kwargs(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Dict[str, Any]:
 | 
					 | 
				
			||||||
    url = "{}/oauth2/register/{id}".format(
 | 
					 | 
				
			||||||
        _client.base_url,id=id)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    headers: Dict[str, str] = _client.get_headers()
 | 
					 | 
				
			||||||
    cookies: Dict[str, Any] = _client.get_cookies()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    json_json_body = json_body.to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
	    "method": "put",
 | 
					 | 
				
			||||||
        "url": url,
 | 
					 | 
				
			||||||
        "headers": headers,
 | 
					 | 
				
			||||||
        "cookies": cookies,
 | 
					 | 
				
			||||||
        "timeout": _client.get_timeout(),
 | 
					 | 
				
			||||||
        "json": json_json_body,
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.OK:
 | 
					 | 
				
			||||||
        response_200 = OAuth20Client.from_dict(response.json())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return response_200
 | 
					 | 
				
			||||||
    if response.status_code == HTTPStatus.NOT_FOUND:
 | 
					 | 
				
			||||||
        response_404 = cast(Any, None)
 | 
					 | 
				
			||||||
        return response_404
 | 
					 | 
				
			||||||
    if client.raise_on_unexpected_status:
 | 
					 | 
				
			||||||
        raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return None
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    return Response(
 | 
					 | 
				
			||||||
        status_code=HTTPStatus(response.status_code),
 | 
					 | 
				
			||||||
        content=response.content,
 | 
					 | 
				
			||||||
        headers=response.headers,
 | 
					 | 
				
			||||||
        parsed=_parse_response(client=client, response=response),
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly to be used by third parties. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This feature is disabled per default. It can be enabled by a system administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
 | 
					 | 
				
			||||||
    secret is echoed in the response.
 | 
					 | 
				
			||||||
    It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = httpx.request(
 | 
					 | 
				
			||||||
        verify=_client.verify_ssl,
 | 
					 | 
				
			||||||
        **kwargs,
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def sync(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly to be used by third parties. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This feature is disabled per default. It can be enabled by a system administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
 | 
					 | 
				
			||||||
    secret is echoed in the response.
 | 
					 | 
				
			||||||
    It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return sync_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio_detailed(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Response[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly to be used by third parties. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This feature is disabled per default. It can be enabled by a system administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
 | 
					 | 
				
			||||||
    secret is echoed in the response.
 | 
					 | 
				
			||||||
    It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kwargs = _get_kwargs(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
 | 
					 | 
				
			||||||
        response = await __client.request(
 | 
					 | 
				
			||||||
            **kwargs
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return _build_response(client=_client, response=response)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
async def asyncio(
 | 
					 | 
				
			||||||
    id: str,
 | 
					 | 
				
			||||||
    *,
 | 
					 | 
				
			||||||
    _client: AuthenticatedClient,
 | 
					 | 
				
			||||||
    json_body: OAuth20Client,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) -> Optional[Union[Any, OAuth20Client]]:
 | 
					 | 
				
			||||||
    """Set OAuth2 Client using OpenID Dynamic Client Registration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
 | 
					 | 
				
			||||||
    facing the
 | 
					 | 
				
			||||||
    public internet directly to be used by third parties. It implements the OpenID Connect
 | 
					 | 
				
			||||||
    Dynamic Client Registration Protocol.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    This feature is disabled per default. It can be enabled by a system administrator.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
 | 
					 | 
				
			||||||
    secret is echoed in the response.
 | 
					 | 
				
			||||||
    It is not possible to retrieve it later on.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    To use this endpoint, you will need to present the client's authentication credentials. If the
 | 
					 | 
				
			||||||
    OAuth2 Client
 | 
					 | 
				
			||||||
    uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
 | 
					 | 
				
			||||||
    secret in the URL query.
 | 
					 | 
				
			||||||
    If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
 | 
					 | 
				
			||||||
    header.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
 | 
					 | 
				
			||||||
    are
 | 
					 | 
				
			||||||
    generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Args:
 | 
					 | 
				
			||||||
        id (str):
 | 
					 | 
				
			||||||
        json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
 | 
					 | 
				
			||||||
            Connect flows. Usually, OAuth 2.0 clients are
 | 
					 | 
				
			||||||
            generated for applications which want to consume your OAuth 2.0 or OpenID Connect
 | 
					 | 
				
			||||||
            capabilities.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Raises:
 | 
					 | 
				
			||||||
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
 | 
					 | 
				
			||||||
        httpx.TimeoutException: If the request takes longer than Client.timeout.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Returns:
 | 
					 | 
				
			||||||
        Response[Union[Any, OAuth20Client]]
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return (await asyncio_detailed(
 | 
					 | 
				
			||||||
        id=id,
 | 
					 | 
				
			||||||
_client=_client,
 | 
					 | 
				
			||||||
json_body=json_body,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    )).parsed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue